Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| *.py[co] | |
| *.egg-info/ | |
| /MANIFEST | |
| /build/ | |
| /dist/ |
| 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) {} |
| 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 |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| #!/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]) |
| #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" |
A slightly updated version of this doc is here on my website.
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.
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.
| /* ========================================================================= | |
| 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 |