Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| require 'sinatra' | |
| get "/" do | |
| erb :form | |
| end | |
| post '/save_image' do | |
| @filename = params[:file][:filename] | |
| file = params[:file][:tempfile] |
| # adding and committing | |
| git add -A # stages All | |
| git add . # stages new and modified, without deleted | |
| git add -u # stages modified and deleted, without new | |
| git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed. | |
| git commit --amend --no-edit # Do so without having to edit the commit message. | |
| # remotes - pushing, pulling, and tracking | |
| git fetch # gets remote objects and refs. Needed if new branches were added on the remote. | |
| git remote -v # Lists all remotes (verbose) |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Create a Gem - Make it a Command Line Interface - Add Rspec Tests Using Bundler & Thor
#Creating your own Gem
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| require 'sequel' | |
| DB = Sequel.connect('postgres://user:pass@localhost/db') | |
| DB.listen(:my_channel, loop: true) {|channel, pid, payload| puts "Got payload '#{payload}' on channel '#{channel}'" } |
| /* | |
| Split an array into chunks and return an array | |
| of these chunks. | |
| With kudos to github.com/JudeQuintana | |
| This is an update example for code I originally wrote 5+ years ago before | |
| JavaScript took over the world. | |
| Extending native objects like this is now considered a bad practice, so use |