This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ajax (url, parms) { | |
parms = parms || {}; | |
var req = new XMLHttpRequest(), | |
post = parms.post || null, | |
callback = parms.callback || null, | |
timeout = parms.timeout || null; | |
req.onreadystatechange = function () { | |
if ( req.readyState != 4 ) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## This nginx.conf servers as the main config file for webflow reverse proxy | |
## | |
## RCS: | |
## https://gist.github.com/sansmischevia/5617402 | |
## | |
## Hardening tips: | |
## http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html | |
## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /p/ { | |
try_files $uri @s3; | |
} | |
location @s3{ | |
proxy_pass http://my_bucket.s3.amazonaws.com; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="logo"><a href="/" class="at"><svg width="149" height="85"><g transform="translate(50,39)"><rect class="logo-b" x="-38" y="-14" width="6" height="6"></rect><rect class="logo-b" x="-38" y="-7" width="6" height="6"></rect><rect class="logo-b" x="-38" y="0" width="6" height="6"></rect><rect class="logo-b" x="-38" y="7" width="6" height="6"></rect><rect class="logo-b" x="-38" y="14" width="6" height="6"></rect><rect class="logo-b" x="-31" y="14" width="6" height="6"></rect><rect class="logo-b" x="-24" y="14" width="6" height="6"></rect><rect class="logo-b" x="-24" y="7" width="6" height="6"></rect><rect class="logo-b" x="-24" y="0" width="6" height="6"></rect><rect class="logo-b" x="-31" y="0" width="6" height="6"></rect><rect class="logo-u" x="0" y="0" width="6" height="6"></rect><rect class="logo-u" x="-14" y="0" width="6" height="6"></rect><rect class="logo-u" x="0" y="7" width="6" height="6"></rect><rect class="logo-u" x="0" y="14" width="6" height="6"></rect><rect class="logo-u" x="-14" y="7" width=" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost 109.74.199.47:80> | |
ServerAdmin admin@myserver.com | |
ServerName myserver.com | |
ServerAlias www.myserver.com | |
ProxyRequests off | |
<Proxy *> | |
Order deny,allow | |
Allow from all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Text; | |
public static class CompressUtil { | |
public static string ToCompressed(this string val) { | |
if (!IsStringCompressed(val)) { | |
return CompressString(val); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using namedtuple and object_hook: | |
import json | |
from collections import namedtuple | |
data = '{"name": "John Smith", "hometown": {"name": "New York", "id": 123}}' | |
# Parse JSON into an object with attributes corresponding to dict keys. | |
x = json.loads(data, object_hook=lambda d: namedtuple('X', d.keys())(*d.values())) | |
print x.name, x.hometown.name, x.hometown.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Method one - PSEXEC | |
An easy way to get a CMD prompt as SYSTEM is to grab PSEXEC from Microsoft Sysinternals: | |
1. Download PSEXEC and unzip to some folder. | |
2. Open an elevated CMD prompt as an administrator. | |
3. Navigate to the folder where you unzipped PSEXEC.EXE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh-keygen -f ~/.ssh/personalid -C "personalid" | |
Generating public/private rsa key pair. | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: | |
Your identification has been saved in /Users/manthony/.ssh/personalid. | |
Your public key has been saved in /Users/manthony/.ssh/personalid.pub. | |
The key fingerprint is: | |
7a:9c:b2:9c:8e:4e:f4:af:de:70:77:b9:52:fd:44:97 personalid | |
The key's randomart image is: | |
+--[ RSA 2048]----+ |