Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
# View my Jekyll blog http://paulstamatiou.com and my jekyll migration post http://paulstamatiou.com/how-to-wordpress-to-jekyll/ | |
# | |
# | |
# based on the import script by icebreaker, which is based on mojombo's | |
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb | |
# https://gist.github.com/303570 | |
# edited to rewrite image URLs to use my CloudFront URL | |
require 'rubygems' | |
require 'sequel' |
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
# This should be run on a new Linode Ubuntu 32-bit 10.04 image as root to prepare it for Nginx, PHP, MySQL, Node, CouchDB environment | |
# To start, something like this works: | |
# scp prepare_server.sh [email protected]:/root | |
# First, install basic linux utilities (compilers, git, libssl) | |
cd /root | |
mkdir /src | |
cd src |
function html5_canvas() { | |
// declear variables | |
var $canvas, $rect, $circle, $triangle, $i, $limit, $width, $height; | |
//create canvas object with div id | |
$canvas = new fabric.Canvas('canvas_1'); | |
// create Circle - note radius |
function html5_canvas() { | |
// declare variables | |
var $canvas, $element, $circle, $rect, $triangle, $x, $limit, $angle, $centerY, $range, $speed; | |
//dom block element wrapper | |
$element = doodle.createDisplay("canvas"); | |
//creates new canvas element wrapper | |
$canvas = $element.createLayer(); | |
// function to create a random number |
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
#!/bin/bash | |
# Script adb+ | |
# Usage | |
# You can run any command adb provides on all your currently connected devices | |
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command> | |
# | |
# Examples | |
# ./adb+ version | |
# ./adb+ install apidemo.apk | |
# ./adb+ uninstall com.example.android.apis |
function fizzbuzz(a, b) { | |
for (var i = a; i <= b; i++) { | |
if (i % 3 == 0 && i % 5 == 0) { | |
console.log("Fizzbuzz"); | |
} else if (i % 5 == 0) { | |
console.log("Buzz"); | |
} else if (i % 3 == 0) { | |
console.log("Fizz"); | |
} else { | |
console.log(i); |
/* Véi, foca no código | |
.---. | |
/o o\ | |
__(= " =)__ | |
//\'-=-'/\\ | |
) (_ | |
/ `"=-._ | |
/ \ ``"=. |
The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:
Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.