Skip to content

Instantly share code, notes, and snippets.

View senthilnayagam's full-sized avatar

Senthil Nayagam senthilnayagam

View GitHub Profile
@dmikey
dmikey / litecoin genesis block
Created January 10, 2014 18:36
create litecoin genesis block, the missing code
assert(block.hashMerkleRoot == uint256("0x38ca78a781d3c571a681ea2241ffb1e0d89bd1ecd3499f1bf6edeaa8751e7151"));
// If genesis block hash does not match, then generate new genesis hash.
if (false && block.GetHash() != hashGenesisBlock)
{
printf("Searching for genesis block...\n");
// This will figure out a valid hash and Nonce if you're
// creating a different genesis block:
uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
uint256 thash;
@caius
caius / gist:6669933
Created September 23, 2013 12:48
Script to grab MSFT Virtualbox VMs for mac
require "net/http"
require "uri"
base_dir = File.expand_path(ARGV.first || ".")
response = Net::HTTP.get(URI("http://www.modern.ie/en-us/virtualization-tools"))
urls = response.scan(/[^"'\s]+VirtualBox\/OSX[^"'\s]+/)
urls.each do |u|
name = u[%r{VirtualBox/OSX/([^/]+)}, 1]
FROM ubuntu
MAINTAINER Code Climate <[email protected]>
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y curl libssl-dev libssl0.9.8 autoconf build-essential
RUN mkdir -p /app/vendor/ruby-1.9.3 && cd /app/vendor/ruby-1.9.3 && curl "https://s3.amazonaws.com/heroku-buildpack-ruby/ruby-1.9.3.tgz" -s -o - | tar zxf -

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@zupo
zupo / folder_splitter.py
Created June 24, 2013 12:56
Split a folder with many files into subfolders with N files. Usage: python folder_splitter.py path/to/target/folder
# -*- coding: utf-8 -*-
# @author: Peter Lamut
import argparse
import os
import shutil
N = 10 # the number of files in seach subfolder folder
@paulczar
paulczar / Dockerfile
Created June 14, 2013 03:38
Chef-Zero Docker File
# Chef-Zero
#
# VERSION 0.0.1
FROM base
MAINTAINER Paul Czarkowski "[email protected]"
RUN apt-get update
RUN apt-get install -y ruby1.9.1-dev build-essential
@JensRantil
JensRantil / execute.sh
Last active November 10, 2021 11:30
Simple test to test SIGINT signal handling of Go.
#!/bin/bash
# Executed on MacOSX
go build signal.go
./signal &
kill -INT $!
# Prints the "interrupt" and quits after 5 seconds, which is to be expected.
@branch14
branch14 / ruby-signaturepad-to-image.rb
Created December 11, 2012 14:15
convert json signatures captured by thomasjbradley's signature-pad to an image
# see https://github.com/thomasjbradley/signature-pad for more details
instructions = JSON.load(data).map { |h| "line #{h['mx']},#{h['my']} #{h['lx']},#{h['ly']}" } * ' '
system "convert -size 198x55 xc:transparent -stroke blue -draw '#{instructions}' signature.png"
@anandkunal
anandkunal / simple_reverse_proxy.go
Created September 4, 2012 21:12
Simple reverse proxy in Go.
package main
import (
"log"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {