Skip to content

Instantly share code, notes, and snippets.

@tuksik
tuksik / gfm.php
Created February 25, 2013 19:50 — forked from koenpunt/gfm.php
<?php
function gfm($text){
# Extract pre blocks
$extractions = array();
$text = preg_replace_callback('/<pre>.*?<\/pre>/s', function($matches) use (&$extractions){
$match = $matches[0];
$md5 = md5($match);
$extractions[$md5] = $match;
@tuksik
tuksik / README.md
Created April 21, 2013 07:47 — forked from ngauthier/README.md
Installs ruby-2.0.0-p0 on ubuntu
@tuksik
tuksik / ddns.py
Created May 11, 2014 00:21 — forked from pklaus/ddns.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written on 2013-02-04 by Philipp Klaus <philipp.l.klaus →AT→ web.de>.
Check <https://gist.github.com/4707775> for newer versions.
A script to update the A and AAAA RRs of HOSTNAME on a DNS server
according to your actual ones using nsupdate / TSIG.
This script is ready to run on Mac OS X (10.8) but you should be able
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
" Teach vim to syntax highlight Vagrantfile as ruby
"
" Install: $HOME/.vim/plugin/vagrant.vim
" Author: Brandon Philips <brandon@ifup.org>
augroup vagrant
au!
au BufRead,BufNewFile Vagrantfile set filetype=ruby
augroup END

Set up screen

  1. docker run --detach --interactive --tty --privileged --net=host fedora /bin/bash
  2. docker attach $CONTAINER_ID
  3. yum install screen

Create screen session

  1. docker attach $CONTAINER_ID
  2. screen -S test
  3. Detach from screen

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@tuksik
tuksik / gist:08e14c3febd730b11329
Last active August 29, 2015 14:16 — forked from bobbidigital/gist:f12e1156cb3b728b72fb
Generate a Signed URL that Expires (Python)
import boto
import boto.s3.connection
access_key = ''
secret_key = ''
conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key,
#is_secure=False, # uncomment if you are not using ssl
calling_format = boto.s3.connection.OrdinaryCallingFormat(),
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
#!/usr/bin/env python
# with help and inspiration from
# * ASN1_generate_nconf(3) (specifically the SubjectPublicKeyInfo structure)
# * http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# * http://blog.oddbit.com/2011/05/converting-openssh-public-keys.html
import sys
import base64
import struct