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
<title>some bubble fun</title> | |
<style> | |
body { | |
font-family: Arial; | |
padding-top: 10%; padding-left: 30%; | |
} |
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
var IncomingForm = require('formidable'); | |
var util = require('util'); | |
var EventEmitter = require('events').EventEmitter; | |
var GridStore = require('mongodb').GridStore; | |
var pauseStream = require('pause-stream'); | |
var ObjectID = require('mongodb').ObjectID; | |
function IncomingFormGridFS(options) { | |
if(!(this instanceof IncomingFormGridFS)) return new IncomingFormGridFS(options); |
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
var passport = require('passport'); | |
var BasicStrategy = require('passport-http').BasicStrategy; | |
var config = require('./config'); | |
passport.use(new BasicStrategy(function(user, pass, done) { | |
if (user !== config.auth.user) { | |
return done(null, false, { | |
message: 'Unknown user ' + user | |
}); | |
} |
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 alphabetSoup(str) { | |
return str.split(' ').map(function(word) { | |
var parts = word.substr(1,word.length-2).split('') | |
.sort(function(){ return Math.random(); }) | |
.join(''); | |
return word[0] + parts + word[word.length-1]; | |
}).join(' '); | |
} | |
function rollercaster(str) { |
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
<!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 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
// 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 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
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 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
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 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
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 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
#!/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: |