View osx-for-hackers.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
 
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
 
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
View .bash_profile
1 2 3 4 5 6 7 8 9
function git_branch_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ [\1\]/'
}
export -f git_branch_brackets
TITLEBAR="\[\033]0;\u@\h:\w\007\]"
export PS1="${TITLEBAR}\[\033[31m\]\u@\h\[\033[00m\]:\[\033[37m\]\w\[\033[00m\]\[\033[0;32m\]\$(git_branch_brackets)\[\033[00m\]$ "
View gist:cbbd18bf5af736cedc5b
1 2 3 4 5 6 7 8 9 10
$.each(['.some-content-div', '#another-div'], function(i,elem){
$(elem).find('a[href^="http"]').each(function(){
var url = new String(this),
_url = url.replace(".", "");
 
if(_url.indexOf('youtube') != -1) {
// console.log("this is a youtube video");
youtube.addVideo(this);
View gist:7635090
1 2 3 4 5 6 7 8 9 10
Nov 24, 2013: 4 draws.
 
Draw 1:
1 'Gantr (Ran)'
2 'Ninelives'
3 'Aldo Mas'
4 'Gaivera Aerillis'
5 'Krys Nemu'
6 'Sophie (Ada Prowbreaker)'
7 'N\'icte Maldo'
View 0_reuse_code.js
1 2
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:5910971
1 2 3 4 5 6 7 8 9 10
Create SSH tunnel to localhost:
ssh -L 5901:127.0.0.1:5901 -L 5902:127.0.0.1:5092 ... -L 5999:127.0.0.1:5999 root@your-xen-host
 
(this command must be run as root).
 
After that you can connect to vncterm, listening on localhost on XCP host.
 
You can find requied VNC port from xenstore:
 
xe vm-list uuid=vmuuid params=dom-id (here you got domID for VM)
View json_decode_nice.php
1 2 3 4 5 6 7 8 9
<?php
function json_decode_nice($json, $assoc = FALSE){
$json = str_replace(array("\n","\r"),"",$json);
$json = preg_replace('/([{,]+)(\s*)([^"]+?)\s*:/','$1"$3":',$json);
$json = preg_replace('/(,)\s*}$/','}',$json);
return json_decode($json,$assoc);
}
// Example:
View gist:5292867
1 2 3 4 5
<?php # Add the following to config.inc.php
$cfg['Export']['sql_drop_database'] = true;
$cfg['Export']['sql_drop_table'] = true;
$cfg['Export']['compression'] = 'zip';
View gist:4392899
1 2 3 4 5 6 7 8 9
function OnEvent(event, arg, family)
 
--OutputLogMessage("event = %s, arg/gkey = %s, mkey = %s, family = %s\n", event, arg, mkey, family )
if "G_PRESSED" == event then
if ( IsKeyLockOn('numlock') == false ) then
PressAndReleaseKey('numlock');
end
end
end
View gist:3251104
1 2 3 4 5 6 7
70264 Gigabyte Z77-D3H ATX LGA1155 Z77 DDR3 3PCI-E16 3PCI-E1 HDMI CrossFireX SATA3 USB3.0 Motherboard
70541 Intel Core i5 3570K Unlocked Quad Core Processor LGA1155 3.4GHZ Ivy Bridge 6MB Retail
70944 Kingston KHX1600C10D3B1K2/16G 16GB Kit 2X8GB 1600MHz DDR3 240PIN DIMM CL10 1.5V
67326 Antec Three Hundred Two Mid Tower Gaming Case 302 ATX 3X5.25 6X3.5INT No PS Front USB3.0 & Audio
17129 Antec TriCool 120MM Case Fan 3-SPEED 1200/1600/2200RPM 25/28/30DBA 39/56/79CFM 3 & 4P *IR-$3*
53611 Corsair Cooling Air Series A50 Performance CPU Cooler LGA775 LGA1155 LGA1156 LGA1366 AM2 AM3
38649 Corsair Professional HX750W 750W ATX 12V 62A 24PIN ATX Modular Power Supply Active PFC 140MM Fan
Something went wrong with that request. Please try again.