As configured in my dotfiles.
start new:
tmux
start new with Unicode (to remove annoying empty space corruption while running zsh):
(function() { | |
function setSelectedSize(s) { | |
var arr = document.getElementsByTagName(window.getSelection().baseNode.parentNode.tagName); | |
for(var i=0; i<arr.length; i++) { | |
arr[i].style.fontSize = "" + s + "px"; | |
} | |
} | |
window.addEventListener("mouseup", function() { | |
if(window.getSelection().type == "Range") { |
# gemfile | |
gem 'asset_sync' | |
# application.rb | |
config.assets.initialize_on_precompile = true | |
config.assets.precompile += ['stuff.js', 'stuff.css'] | |
# production.rb | |
config.assets.enabled = true |
git remote add forked [email protected]:NEW_APP_NAME.git | |
git remote rename heroku old | |
git remote rename forked heroku | |
git push heroku master | |
heroku labs:enable user-env-compile -a NEW_APP_NAME |
<IfModule mod_rewrite.c> | |
Options +FollowSymlinks | |
RewriteEngine on | |
rewritecond %{http_host} ^OLD_SITE.com [nc] | |
rewriterule ^(.*)$ http://NEW_SITE.com/$1 [r=301,nc] | |
</IfModule> |
Undo a commit and redo | |
$ git commit ... (1) | |
$ git reset --soft 'HEAD^' (2) | |
$ edit (3) | |
$ git add .... (4) | |
$ git commit -c ORIG_HEAD (5) | |
This is what you want to undo | |
This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset". (The quotes may or may not be required in your shell) |
As configured in my dotfiles.
start new:
tmux
start new with Unicode (to remove annoying empty space corruption while running zsh):
// Note that a shortcut is created automagically if the app is installed via Play store. | |
// Change "APP_NAME" by your app name. *MrObvious* | |
/*Manifest file - add this */ | |
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> | |
/* MainActivity.java */ | |
public class MainActivity ... { | |
... | |
private SharedPreferences appSettings; |
# Count lines in a files (zsh, bash) | |
cat big-file.sql | sed '/^\s*$/d' | wc -l | |
# Count result of search ... | |
grep 'something' big-file.sql | sed '/^\s*$/d' | wc -l |
--- | |
- name: Deploy new site release | |
user: deployer | |
hosts: all | |
tasks: | |
- name: Fetch repo updates | |
git: > | |
[email protected]:my/repo.git |