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 / 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>
@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 / 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 / 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 / gist:0f8bc9c281f43faf267e
Last active August 29, 2015 14:14 — forked from maskit/gist:2252422
Sniff WebSocket data
(function () {
WebSocket.prototype._send = WebSocket.prototype.send;
WebSocket.prototype.send = function (data) {
this._send(data);
this.addEventListener('message', function (msg) {
console.log('>> ' + msg.data);
}, false);
this.send = function (data) {
this._send(data);
console.log("<< " + data);

patch-edid.rb

A script to fix EDID problems on external monitors in Mac OS.

  1. Connect the problem monitor.

  2. Download this script into your /System/Library/Displays/Overrides (note: this file is only writeable by root, so some commands require sudo).

#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"
" ftplugin/haskell.vim
set tags=tags;/,codex.tags;/
" Disable haskell-vim omnifunc
let g:haskellmode_completion_ghc = 0
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
autocmd FileType haskell nnoremap <buffer> <F1> :HdevtoolsType<CR>
@elventear
elventear / README.md
Created July 14, 2016 21:30
Numerical Testing Sample with py.test parametrization

Original

Output

[2.7.10;@radtrack tests]$ py.test -v AnalyticCalc1_test.py
========================================== test session starts ===========================================
platform linux2 -- Python 2.7.10, pytest-2.8.3, py-1.4.30, pluggy-0.3.1 -- /home/vagrant/.pyenv/versions/2.7.10/bin/python
cachedir: ../.cache
rootdir: /home/vagrant/radtrack, inifile:
plugins: xdist-1.13.1
collected 1 items
@elventear
elventear / vm-resize-hard-disk.md
Created January 12, 2017 06:29 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where: