git branch --set-upstream-to=upstream/branchname
git fetch upstream -n
| # CSS | |
| # add missing semicolon to last property | |
| ([^;])$(\n}) | |
| $1;$2 | |
| # Shorten hex color values | |
| #([\da-f])\1([\da-f])\2([\da-f])\3\b | |
| #$1$2$3 |
| // Place your settings in this file to overwrite the default settings | |
| { | |
| "editor.tabSize": 2, | |
| "editor.insertSpaces": true, | |
| "editor.wordWrap": "off", | |
| "editor.detectIndentation": false, | |
| "files.associations": { | |
| "*.css.erb": "css", | |
| "*.ejs": "html", | |
| "*.pac": "javascript", |
| # Your snippets | |
| # | |
| # Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
| # expand the prefix into a larger code block with templated values. | |
| # | |
| # You can create a new snippet in this file by typing "snip" and then hitting | |
| # tab. | |
| # | |
| # An example CoffeeScript snippet to expand log to console.log: | |
| # |
| # Go to package repo page | |
| npm repo $package | |
| # Go to package home page | |
| npm home $package | |
| # List outdated packages | |
| npm outdated | |
| # Remove extraneous packages |
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # run after updating: source ~/.bashrc | |
| # some lazy ls aliases | |
| alias ll='ls -alF' | |
| alias la='ls -A' | |
| alias l='ls -CF' | |
| # Alias definitions. | |
| # You may want to put all your additions into a separate file like |
| #/usr/bin/env bash | |
| # git hook to run a command after `git pull` if a specified file was changed | |
| # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
| } |
| # Packages | |
| *.xpi | |
| *.zip | |
| # Logs and databases | |
| *.log | |
| *.sql | |
| *.sqlite | |
| # OS generated files |
| try { | |
| window.localStorage.setItem('testKey', '1'); | |
| window.localStorage.removeItem('testKey'); | |
| } | |
| catch (error) { | |
| window.localStorage = { | |
| _data: {}, | |
| setItem: function(id, val) { return this._data[id] = String(val); }, | |
| getItem: function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; }, | |
| removeItem: function(id) { return delete this._data[id]; }, |
| <?php | |
| $filename = 'IMAGE_PATH'; | |
| $image = imagecreatefromjpeg($filename); | |
| $width = imagesx($image); | |
| $height = imagesy($image); | |
| $pixel = imagecreatetruecolor(1, 1); | |
| imagecopyresampled($pixel, $image, 0, 0, 0, 0, 1, 1, $width, $height); | |
| $rgb = imagecolorat($pixel, 0, 0); | |
| $color = imagecolorsforindex($pixel, $rgb); | |
| ?> |