Skip to content

Instantly share code, notes, and snippets.

@jb510
jb510 / ReadMe.md
Last active January 20, 2022 15:42 — forked from boogah/ale.bash
Auto Update Brew: OS X Launchd job and script to automatically update homebrew
  1. Place homebrewupdate.sh where ever you like, I use ~/bin/homebrewupdate.sh
  2. Place the .plist file in ~/Library/LaunchAgents and update the path to your bash script
  3. run launchctl load ~/Library/LaunchAgents/com.jb510.homebrewupdate.plist or whatever you've named your plist file.
  4. check launchctl list | grep jb510 to see that it's running

Note: You might need to chmod +x homebrewupdate.sh

Note 2: you can run this manually to test your script ~/bin/homebrewupdate.sh

Future: Update this to also update casks https://github.com/buo/homebrew-cask-upgrade or using brew cask list | xargs brew cask reinstall

@mishak87
mishak87 / ip.conf
Created April 23, 2014 01:39
Nginx: Support only requests with Host header (disable access via bare IP)
# this file blocks ip requests - only request with Host are supported
server {
listen 80 default_server;
listen 443 default_server ssl;
server_name _;
return 444;
}
anonymous
anonymous / dabblet.css
Created February 21, 2014 09:09
Typing animation with pure CSS.
/**
* Typing animation with pure CSS.
* Works best in browsers supporting the ch unit.
*/
@keyframes typing { from { width: 0; } }
@keyframes blink-caret { 50% { border-color: transparent; } }
h1 {
font: bold 200% Consolas, Monaco, monospace;
@burke
burke / remotepaste.md
Last active September 26, 2023 11:04
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@klovadis
klovadis / gist:5170446
Created March 15, 2013 14:59
Two Lua scripts for Redis to turn HGETALL and HMGET into dictionary tables
-- gets all fields from a hash as a dictionary
local hgetall = function (key)
local bulk = redis.call('HGETALL', key)
local result = {}
local nextkey
for i, v in ipairs(bulk) do
if i % 2 == 1 then
nextkey = v
else
result[nextkey] = v
@gkzhong
gkzhong / README
Created August 25, 2012 15:36
在Rime五筆輸入方案中添加繁體輸出
一,安裝簡體->繁體映射碼表:(該項目由opencc維護:http://code.google.com/p/opencc)
文件1:http://code.google.com/p/rimeime/source/browse/trunk/misc/opencc/data/simp_to_trad_characters.ocd
文件2:http://code.google.com/p/rimeime/source/browse/trunk/misc/opencc/data/simp_to_trad_phrases.ocd
安裝位置:共享資料目錄
如:/Library/Input Methods/Squirrel.app/Contents/SharedSupport/opencc
二,添加opencc簡繁配置文件:
詳見:zhs2zht.ini
安裝位置:共享資料目錄
如:/Library/Input Methods/Squirrel.app/Contents/SharedSupport/opencc
@chluehr
chluehr / date_loop.sh
Created April 26, 2012 20:28
Bash: Loop over dates
#!/bin/bash
now=`date +"%Y-%m-%d" -d "05/06/2012"`
end=`date +"%Y-%m-%d" -d "05/23/2012"`
while [ "$now" != "$end" ] ;
do
now=`date +"%Y-%m-%d" -d "$now + 1 day"`;
echo $now
done

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@jehiah
jehiah / simple_args_parsing.sh
Created March 4, 2011 16:56
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"