Skip to content

Instantly share code, notes, and snippets.

View yrcjaya's full-sized avatar

Jayaseelan Yezhuaralai yrcjaya

View GitHub Profile
@zed
zed / .gitignore
Last active August 12, 2017 08:24
Find executables in %PATH% that match PATTERN.
*.py[co]
*.egg-info/
/MANIFEST
/build/
/dist/
@jezdez
jezdez / fabfile.py
Created November 22, 2009 14:36
Fabric file to run a command in a openvz guest without outside connectivity
from fabric_openvz import guests, vz_run
@guests('uhura', 'obiwan')
def uname_a(guest):
"""
Show uname -a on given guests
"""
vz_run(guest, 'uname -a')
@guests('uhura', 'obiwan')
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@albertobajo
albertobajo / parse_signed_request
Created November 10, 2010 10:03
Python implementation of Facebook's php signed_request parser: http://developers.facebook.com/docs/authentication/canvas
import hmac
import simplejson as json
from base64 import urlsafe_b64decode
from hashlib import sha256
def parse_signed_request(signed_request, secret):
[encoded_sig, payload] = signed_request.split('.')
# decode data
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@dunhamsteve
dunhamsteve / tabla_recta.py
Last active October 8, 2015 01:49
A python script to generate a wallet-sized "table recta" for passwords
#!/usr/bin/python
# This code is public domain, share and enjoy.
import random, re, sys, os
seed = None
if len(sys.argv) > 1:
seed = int(sys.argv[1])
@srkirkland
srkirkland / deploy.ps1
Created September 10, 2012 22:18
TeamCity CI Deploy Azure PowerShell Script
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
Write-Output "Running Azure Imports"
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@freeformz
freeformz / WhyILikeGo.md
Last active October 6, 2022 23:31
Why I Like Go

A slightly updated version of this doc is here on my website.

Why I Like Go

I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.

Goroutines

The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x), where f() is a function.

@hintjens
hintjens / zcurve.c
Last active December 15, 2015 07:39
CurveZMQ prototype - see http://hintjens.com/blog:36 for the story.
/* =========================================================================
CurveZMQ - authentication and confidentiality for 0MQ
-------------------------------------------------------------------------
Copyright (c) 1991-2013 iMatix Corporation <www.imatix.com>
Copyright other contributors as noted in the AUTHORS file.
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at