Skip to content

Instantly share code, notes, and snippets.

View shiroyasha's full-sized avatar

Igor Šarčević shiroyasha

View GitHub Profile
@shiroyasha
shiroyasha / gist:5481111
Created April 29, 2013 11:44
Sublime better monokai highlight
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai Bright</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@shiroyasha
shiroyasha / sources.list
Last active August 29, 2015 14:01
Fast ubuntu mirrors
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
class Animal
def initialize(name)
@name = name
end
def to_s
@name
end
end
#!/usr/bin/python
import curses
import random
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
curses.halfdelay(1)
@shiroyasha
shiroyasha / dog.rb
Created February 16, 2016 22:20
Method tracer for Ruby classes
class Dog
attr_writer :name
def initialize(name)
@name = name
end
def bark
puts "patrick"
end
cd /tmp
apk --update add libstdc++ libgcc
wget https://s3-us-west-1.amazonaws.com/renderedtext-alpine-packages/thrift-0.9.3.tar.gz
tar xvzf thrift-0.9.3.tar.gz
mv thrift/thrift /usr/bin
mv thrift/thrift-0.9.3 /usr/lib/erlang/lib
rm -rf thrift-0.9.3.tar.gz
#/bin/bash
set -ex
keys=(
9554F04D7259F04124DE6B476D5A82AC7E37093B
94AE36675C464D64BAFA68DD7434390BDBE9B9C5
0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93
FD3A5288F042B6850C66B31F09FE44734EB7990E
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1
function retry {
local n=1
local max=5
local delay=15
while true; do
"$@" && break || {
if [[ $n -lt $max ]]; then
((n++))
echo "Command failed. Attempt $n/$max:"
sleep $delay;
cd /tmp
echo "Installing GCC and frieds"
sudo apt install \
gcc make \
pkg-config autoconf automake \
python3-docutils \
libseccomp-dev \
libjansson-dev \
cd /tmp
echo "Installing GCC and frieds"
sudo apt-get update -y
sudo apt -y install \
gcc make \
pkg-config autoconf automake \
python3-docutils \
libseccomp-dev \