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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Demo for Basic Image Filtering Using a Canvas Element</title> | |
</head> | |
<body> | |
<div> | |
<input type="file" id="loader"> |
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
// Also handles special characters and uppercase | |
// like in “Amore, Roma“, “A man, a plan, a canal: Panama” or “No ‘x’ in ‘Nixon’“ | |
// (Unfortunately doesn't fit into 80 chars) | |
function isPalindrome(str) { | |
var stripped = str.toLowerCase().replace(/[^a-z]/g, ''); | |
return stripped === stripped.reverse(); | |
} |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
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
var fs = require('fs'); | |
var path = require('path'); | |
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var esnext = require('gulp-esnext'); | |
var es6Modules = require('gulp-es6-module-transpiler'); | |
var concat = require('gulp-concat'); | |
var insert = require('gulp-insert'); | |
var uglify = require('gulp-uglify'); | |
var cache = require('gulp-cached'); |
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
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var uglify = require('gulp-uglify'); | |
var jshint = require('gulp-jshint'); | |
var insert = require('gulp-insert'); | |
var livereload = require('gulp-livereload'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var watchify = require('watchify'); | |
var browserify = require('browserify'); |
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 ruby | |
# ABOUT: creates a number of screenshots for all video files in a directory | |
# ATTENTION: make sure to run `gem install streamio-ffmpeg` | |
# USAGE: converter.rb <source dir> <target dir> | |
require "rubygems" | |
require "streamio-ffmpeg" | |
# CONFIGURATION: |
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
// Initialze | |
var designer = graphicDesigner({ | |
// required: | |
element: '#container', | |
// optional: | |
unit: 'pixel' // `pixel` or `inch` or `mm` | |
dpi: 300, // only use with inch or mm | |
width: 500, | |
height: 500, | |
scaleFactor: 1, |
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
describe('following another user', function() { | |
declare({ | |
// get rid of small functions with partials | |
firstUser: partial(createUser, 'foo'), | |
secondUser: partial(createUser, 'bar') | |
// no need for function introspection with this syntax | |
// get knows strings describe dependencies and function are async | |
// getTimeline is a function that accepts a user as arugment now | |
timeline: partial(get, 'firstUser', getTimeline), |
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 ruby | |
# USAGE: | |
# Script can be called from the command line with `./log_stats.rb`. | |
# Optional a log file can be specified: `./log_stats.rb path/to/file.log`. | |
# This function kicks off the script in case it's called from the command line | |
def run! |
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
var upDown = function(name) { | |
return up(name) + '-' + down(name) | |
} | |
var up = function(s) { | |
return s.toUpperCase() | |
} | |
OlderNewer