{ All snippets }

Tweetsnippet is a curated list of tips and tricks from Twitter.

Jonathan Reinink

Jonathan Reinink @reinink

Here's a neat trick for soft deleting relationships in @laravelphp. ? When you delete a record, immediately also soft delete any child records. ? Later, when you restore the parent, automatically also restore all child records that were deleted when the parent was deleted. ? https://t.co/YsYKWtu00R

Daily Web Dev

Daily Web Dev @dailywebdev

? Persist request data when redirecting in Laravel with this trick: Chain withInput() onto your redirects and the request values will get persisted to the redirect location - by flashing data to the session under the hood. Includes querystrings and POST data #php #laravel https://t.co/8Vv7QMvfyl

Steve Schoger

Steve Schoger @steveschoger

? The most frequently asked question I get is how to choose colors for a dark theme. I simply use darker shades for dark themes and lighter shades for light themes. Here is an example that has both dark and light elements. Every color is sampled from the swatches below it: https://t.co/WCa1SFeXse

R. Alex Anderson ?

R. Alex Anderson ? @ralex1993

??? #JavaScript tip: Reduce an array of constants into an object to save yourself a couple lines of code. I'm using linear interpolation here to create an array of x,y,z values from a location, destination, and the movement time. https://t.co/0wlocaJLWu

Daily Web Dev

Daily Web Dev @dailywebdev

A handy little debugging trick you can use in javascript is throwing exceptions to provide descriptive error messages in the console. throw new Error('hello world') ? You can take this one step further by throwing a variable directly (works with all datatypes) #javascript #js https://t.co/BLm2L6A4Qp

Swizec Teller

Swizec Teller @Swizec

Oh you haven't heard of "presentational" attributes? It means they listen to CSS. If you ain't keen on adding a bunch of attributes, you can use CSS. Even styled-components. https://t.co/jFllGjJYlR