This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
// It is important to declare your variables. | |
(function() { | |
var foo = 'Hello, world!'; | |
print(foo); //=> Hello, world! | |
})(); | |
// Because if you don't, the become global variables. | |
(function() { |
<?php | |
// SETUP: | |
// 1. Customize all the settings (stripe api key, email settings, email text) | |
// 2. Put this code somewhere where it's accessible by a URL on your server. | |
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks | |
// 4. Have fun! | |
// set your secret key: remember to change this to your live secret key in production | |
// see your keys here https://manage.stripe.com/account |
function verify_app_store_in_app($receipt, $is_sandbox) | |
{ | |
//$sandbox should be TRUE if you want to test against itunes sandbox servers | |
if ($is_sandbox) | |
$verify_host = "ssl://sandbox.itunes.apple.com"; | |
else | |
$verify_host = "ssl://buy.itunes.apple.com"; | |
$json='{"receipt-data" : "'.$receipt.'" }'; | |
//opening socket to itunes |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
/** | |
* Check if a given ip is in a network | |
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1 | |
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed | |
* @return boolean true if the ip is in this range / false if not. | |
*/ | |
function ip_in_range( $ip, $range ) { | |
if ( strpos( $range, '/' ) == false ) { | |
$range .= '/32'; | |
} |
<?php | |
function getFilesInDirectoryAsArray($directory, $recursive, $arrFilter=array()) { | |
$arrItems = array(); | |
if(substr($directory, strlen($directory)-1, 1) != "/"){ | |
$directory.="/"; | |
} | |
if(count($arrFilter)){ | |
$filterMap=array(); | |
for($i=0;$i<count($arrFilter);$i++){ | |
$filterMap[$arrFilter[$i]]=true; |
Change: $scrapinhub/crawlera_hostname$, $username$, $password$ and you're ready to go. | |
Tested with squid3 | |
hierarchy_stoplist cgi-bin ? | |
acl QUERY urlpath_regex cgi-bin \? | |
no_cache deny QUERY | |
hosts_file /etc/hosts | |
refresh_pattern ^ftp: 1440 20% 10080 | |
refresh_pattern ^gopher: 1440 0% 1440 | |
refresh_pattern . 0 20% 4320 |
var gulp = require('gulp'); | |
var concat = require('gulp-concat'); | |
var sass = require('gulp-sass'); | |
var minifyCss = require('gulp-minify-css'); | |
var rename = require('gulp-rename'); | |
var gulpBowerFiles = require('gulp-bower-files'); | |
var paths = { | |
sass: ['./scss/**/*.scss'], | |
scripts: ['./app/**/*.js', './app/*.js'] |
{ | |
"email": "[email protected]", | |
"zone": "CLOUDFLARE_ZONE", | |
"token": "CLOUDFLARE_TOKEN" | |
} |