Skip to content

Instantly share code, notes, and snippets.

View radekstepan's full-sized avatar

Radek Stepan radekstepan

View GitHub Profile
@radekstepan
radekstepan / .gitignore
Last active March 26, 2016 23:52
array-flatten
/node_modules
*.log
.DS_Store
@radekstepan
radekstepan / app.jsx
Created March 29, 2016 01:55
rangle-react
// Don't forget the imports.
import React from 'react';
import ReactDOM from 'react-dom';
const JSON_URL = "https://api.example.io/comments.json";
class Store {
constructor(data) {
this.data = data;
@radekstepan
radekstepan / .gitignore
Last active March 29, 2016 02:29
Implement a function `pipe()` that takes several functions as arguments and returns a new function that will pass its argument to the first function, then pass the result to the second, then pass the result of the second to the third, and so on, finally returning the output of the last function. In other words, calling `pipe(foo, bar, baz)(1, 2,…
/node_modules
*.log
.DS_Store
export SYSTEM_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo "SYSTEM_SECRET is $SYSTEM_SECRET"
@radekstepan
radekstepan / pbackup.py
Created November 26, 2013 12:25
A backup script that uses the pbworks API to download all pages and files in a given wiki workspace.
#!/usr/bin/python
# -*- coding: utf -*-
import urllib2, json, datetime, os, unicodedata, re, codecs
from threading import Thread
API_KEY = '#'
WIKI = '#'
def slugify(value):
// https://youtu.be/XEt09iK8IXs?t=1258
let t = 0; // try counter
const s = 10; // search space size
let r = Math.floor(Math.random() * s); // rabbit
// Take a guess.
const guess = g => {
t += 1;
console.log('Try', t, 'in', g, 'rabbit in', r);
@radekstepan
radekstepan / docker-install.sh
Last active January 19, 2024 10:13
Install Docker on Debian 7 Wheezy
#/bin/bash
if [ `getconf LONG_BIT` != 64 ]; then
exit 1
fi
sudo apt-get -y update
sudo apt-get -y install lxc wget bsdtar iptables curl golang git aufs-tools mercurial libdevmapper-dev
export GOPATH=~/usr/lib/go