Skip to content

Instantly share code, notes, and snippets.

View elventear's full-sized avatar
🧙‍♂️
Conjuring

Pepe Barbe elventear

🧙‍♂️
Conjuring
View GitHub Profile
@elventear
elventear / every
Created August 22, 2014 18:28 — forked from sorbits/every
#!/usr/bin/env bash
progname=$(basename $0)
version="1.0 (2014-08-17)"
step=2
function create_hash {
openssl dgst -sha1 -binary <<< "$1" | xxd -p
}
@elventear
elventear / mingw.sh
Last active August 29, 2015 14:05 — forked from henry0312/mingw.sh
#!/bin/sh
# 初期設定
WORK=$HOME/Builds/GCC
PREFIX=$HOME/mingw
export PATH="$HOME/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src
@elventear
elventear / gist:cd508811db24b108dc72
Created August 6, 2014 19:11
Type text from Clipboard
set numbers_key_codes to {29, 18, 19, 20, 21, 23, 22, 26, 28, 25}
set input to do shell script "pbpaste"
if (input is not missing value) then
tell application "System Events"
repeat with char in the characters of input
try
set test to char as number
key code numbers_key_codes's item (char + 1)
@elventear
elventear / gist:2424f4d4f8e67e73ef79
Last active August 29, 2015 14:01
Search for a delete git in file in history
# http://stackoverflow.com/questions/7203515/how-to-locate-a-deleted-file-in-the-commit-history
# Search for all instances of the file
git log --all -- <path-to-file>
# Display the contents of the file at SHA
git show <SHA> -- <path-to-file>

Keybase proof

I hereby claim:

  • I am elventear on github.
  • I am elventear (https://keybase.io/elventear) on keybase.
  • I have a public key whose fingerprint is 3CF5 94D8 6350 A6EC 088A 4F6E FF3F A3A3 6A35 26BA

To claim this, I am signing this object:

@elventear
elventear / gist:9942740
Last active August 29, 2015 13:58 — forked from michalbcz/gist:2757630
emulate collectWithIndex
List.metaClass.collectWithIndex = { yield ->
def collected = []
delegate.eachWithIndex { listItem, index ->
collected << yield(listItem, index)
}
return collected
}
assert [1, 1, 1, 1, 1].collectWithIndex { it, index -> it + index } == [1, 2, 3, 4, 5]
@elventear
elventear / wget-alias.terminal
Created November 25, 2013 13:10 — forked from philiparthurmoore/wget-alias.terminal
Make a curl behave like wget with an alias
alias wget="curl -O --retry 999 --retry-max-time 0 -C -"
##
# Line should be placed at ~/.bash_profile
# Source: http://www.mymacosx.com/terminal/wget-replacement-macos.html
# Source: http://superuser.com/questions/142459/persistent-retrying-resuming-downloads-with-curl
##
@elventear
elventear / gist:5759978
Created June 11, 2013 19:45
Make #MacVim new #splits #vertical
defaults write org.vim.MacVim MMVerticalSplit YES
@elventear
elventear / gist:5670630
Created May 29, 2013 14:22
#shell script to #move #types
#!/usr/bin/env zsh
local SCRIPT_NAME=$(basename $0)
local SCRIPT_DIR=$(dirname $0)
. $SCRIPT_DIR/../dependencies/zsh-functional/functional.plugin.zsh
function usage {
test ${#1} -gt 0 && echo ERROR: $1
echo $SCRIPT_NAME SOURCE_TYPE DEST_TYPE
@elventear
elventear / gist:5600769
Created May 17, 2013 17:58
#git #amend #date of commit
git commit --amend --date="$(date -R)"