This file contains 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
# Grab the protocol being used | |
RewriteCond %{HTTPS} =on | |
RewriteRule ^(.+)$ - [env=ps:https] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.+)$ - [env=ps:http] | |
# Force WWW | |
RewriteCond %{HTTP_HOST} !^www\. |
This file contains 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
*** lib/Varien/Db/Select.php 2010-07-26 16:09:28.000000000 -0400 | |
--- lib/Varien/Db/Select.php 2010-12-28 15:42:19.000000000 -0500 | |
*************** | |
*** 33,38 **** | |
--- 33,40 ---- | |
*/ | |
class Varien_Db_Select extends Zend_Db_Select | |
{ | |
+ const TYPE_CONDITION = 'TYPE_CONDITION'; | |
+ |
This file contains 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
#!/usr/bin/env python | |
import sys | |
import sqlite3 | |
import yaml | |
import os | |
import time | |
from os import path | |
# Make sure paths exist |
This file contains 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
#!/usr/bin/env python | |
import sys | |
import yaml | |
import os | |
import time | |
from os import path | |
# Make sure paths exist | |
if len(sys.argv) != 2: |
This file contains 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
NSString *filename = [NSString stringWithFormat:@"%0.0f.png", [[NSDate date] timeIntervalSince1970]]; | |
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; | |
MSLogTo(@"info", @"documentsPath = %@",documentsPath); | |
NSURL *newUrl = [NSURL fileURLWithPath:documentsPath isDirectory:YES]; | |
NSString *saveTo = [[newUrl absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
MSLogTo(@"info", @"Saving image to %@",saveTo); | |
NSError *error; | |
if (![UIImagePNGRepresentation(image) writeToFile:saveTo options:NSDataWritingAtomic error:&error]) { |
This file contains 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
strace $(pidof httpd |sed 's/\([0-9]*\)/\-p \1/g') |
This file contains 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
// Type this into your address bar at simple.com: | |
// It just messes with the background, don't worry about your cookies :D | |
javascript:void(function(){disPage.guilloche.guillocheKey=0;setInterval(function(){disPage.guilloche.guillocheKey++; disPage.guilloche.drawNiceGuilloche();},100)}()); |
This file contains 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
@implementation Observer | |
-(id)init { | |
// ... | |
[_preferences addObserver:self forKeyPath:@"apiKey" options:NSKeyValueObservingOptionNew context:nil]; | |
[_preferences addObserver:self forKeyPath:@"apiSecret" options:NSKeyValueObservingOptionNew context:nil]; | |
} | |
// ... |
This file contains 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
doStuff().then(function(things) { | |
if (!things) { | |
throw new Error("Here I want to skip everything else, including the 'then's after the next catch.."); | |
} | |
if (canMakeNewThing) { | |
// This should continue to the next 'then' | |
return someNewThing.save(); | |
} |
This file contains 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
#!/usr/bin/python | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
# Mirror from http://s3.jspenguin.org/ssltest.py | |
import sys | |
import struct | |
import socket | |
import time |