Skip to content

Instantly share code, notes, and snippets.

@smgt
smgt / keybase.md
Last active February 12, 2022 13:38

Keybase proof

I hereby claim:

  • I am smgt on github.
  • I am smgt (https://keybase.io/smgt) on keybase.
  • I have a public key ASA3bRFagm5GCm-7RBunBAd35iZ0DuANkfSw5RWU-3igTwo

To claim this, I am signing this object:

@smgt
smgt / ruby.sh
Created October 30, 2012 06:38
Install Ruby 1.9.3-p286 when building a VeeWee
# Install Ruby from source
apt-get -y install curl bzip2 unzip
r_ver=1.9.3-p286
curl -o /tmp/ruby-${r_ver}.tar.bz2 \
"ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${r_ver}.tar.bz2"
(cd /tmp && tar -jxvf /tmp/ruby-${r_ver}.tar.bz2 && \
cd ruby-${r_ver} && ./configure --prefix=/usr/local && \
make && make install)
rm -rf /tmp/ruby-${r_ver} /tmp/ruby-${r_ver}.tar.bz2
@smgt
smgt / osx.txt
Created August 1, 2012 15:10
List of OSX settings
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MacBook Pro"
scutil --set HostName "MacBook Pro"
scutil --set LocalHostName "MacBook-Pro"
# Menu bar: disable transparency
@smgt
smgt / AddThis.html
Created July 16, 2012 06:31
Add flattr to AddThis
<html>
<head>
<title>AddThis Flattr Test Page</title>
</head>
<body>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
@smgt
smgt / test_web.rb
Created May 12, 2012 08:04
Glorify test
$: << File.expand_path(".") + '/lib'
require 'sinatra'
require 'glorify'
get "/" do
@example = File.open("README.md", "rb").read
erb :index
end
// Create a new object
ajax = new XMLHttpRequest();
// Try to open a API resource that won't return a 200 or 201
ajax.open("GET", "https://api.flattr.com/rest/v2/user", false);
ajax.send();
// The response
ajax.responseText;
// "{"error":"unauthorized","error_description":"You are unauthorized to access the resource","error_uri":"http:\/\/developers.flattr.net\/api\/"}"
@smgt
smgt / git-sparkmonth
Created November 24, 2011 10:35
Visualize your commits the last 30 days
#!/bin/sh
for day in $(seq 30 -1 0); do
git log --author="John Doe" --before="${day} days" --after="$[${day}+1] days" --format=oneline |
wc -l
done | spark | lolcat -a
@smgt
smgt / now.html
Created April 19, 2011 18:52
NowJS HTML
<html>
<head></head>
<body>
<div id="message">
</div>
<input type="text" id="text-input">
<input type="submit" id="send-button">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="http://localhost:8888/nowjs/now.js"></script>
<script>
<html>
<head></head>
<body>
<div id="message">
</div>
<input type="text" id="text-input">
<input type="submit" id="send-button">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="http://localhost:8888/nowjs/now.js"></script>
<script>
@smgt
smgt / bash_profile.sh
Created April 5, 2011 12:46
Git branch and coloring in command prompt.
source /usr/local/git/contrib/completion/git-completion.bash
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow