Atom automatic update by http://atom.io/packages/sync-settings
View .zshrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fzf | |
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh | |
export FZF_DEFAULT_OPTS="--multi --reverse --border --inline-info --preview '([ -e {} ] && (head -20 {} || tree -C {} | head -20 ) || (echo {})) 2> /dev/null' --preview-window=right:40%:wrap" | |
export FZF_CTRL_R_OPTS="--no-preview" | |
export FZF_CTRL_T_OPTS="--bind 'ctrl-x:execute(subl -a {})'" | |
# fzf bindigs | |
bindkey '^P' fzf-file-widget |
View Personal.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<keymap version="1" name="Personal" parent="Default for XWin"> | |
<action id="BaseOnThisFunction" /> | |
<action id="CheckinProject" /> | |
<action id="CloseActiveTab"> | |
<keyboard-shortcut first-keystroke="shift ctrl w" /> | |
</action> | |
<action id="CloseContent"> | |
<keyboard-shortcut first-keystroke="ctrl w" /> | |
</action> | |
<action id="CompareTwoFiles" /> |
View puppeteer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const puppeteer = require('puppeteer'); | |
(async() => { | |
const browser = await puppeteer.launch({ | |
headless: true, | |
ignoreHTTPSErrors: true, | |
timeout: 1000 |
View atom-update.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $EUID != 0 ]; then | |
echo "You must be root to run this script" 1>&2 | |
exit 1 | |
fi | |
URL_RELEASES="https://github.com/atom/atom/releases/latest" | |
NEW_RELEASE=$(curl -sL $URL_RELEASES | egrep -o 'href="([^"#]+)atom-amd64.deb"' | cut -d'"' -f2 | sort | uniq) | |
NEW_VERSION=$(echo $NEW_RELEASE | egrep -o '[0-9]+\.[0-9]+\.[0-9]+') | |
CURRENT_VERSION=$(atom --version | fgrep Atom | awk '{print $3}') |
View keybase.md
Keybase proof
I hereby claim:
- I am aanton on github.
- I am aanton (https://keybase.io/aanton) on keybase.
- I have a public key ASDy6XVLDZ6WeKCLIJPiQziwfLE1D9XsZqlZxLtyjkMcmgo
To claim this, I am signing this object:
View .gitconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
editor = vim | |
pager = less -r | |
[alias] | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --all --date=iso | |
local = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=iso | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse |
View debug-charsets-requests.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$debug = []; | |
// Configure charset | |
$charsets = ['utf-8', 'iso-8859-1']; | |
$charset = array_key_exists('charset', $_REQUEST) && | |
in_array(mb_strtolower($_REQUEST['charset']), $charsets) ? mb_strtolower($_REQUEST['charset']) : 'utf-8'; | |
ini_set('default_charset', $charset); | |
mb_internal_encoding(ini_get('default_charset')); |
View memcache-list-all-keys.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
# Forked from https://gist.github.com/bkimble/1365005 | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] |
View ConsistentHash.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @see https://github.com/pda/flexihash | |
* @see http://www.martinbroadhurst.com/Consistent-Hash-Ring.html | |
*/ | |
class ConsistentHash | |
{ | |
/** @var int Number of positions to hash each target. This has the effect of distributing the servers more evenly over the ring. Note that this has nothing to do with server replication */ | |
private $replicas; |
NewerOlder