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 / 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: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 / 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 / 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:

@elventear
elventear / csd-wrapper.sh
Created April 20, 2017 22:40 — forked from l0ki000/csd-wrapper.sh
Cisco Anyconnect CSD wrapper for OpenConnect (exhanced to autodownload and autoupdate hostscan)
#!/bin/bash
# Cisco Anyconnect CSD wrapper for OpenConnect
# Enter your vpn host here
CSD_HOSTNAME=
if [[ -z ${CSD_HOSTNAME} ]]
then
echo "Define CSD_HOSTNAME with vpn-host in script text. Exiting."
exit 1
fi