This is the sequence of steps to follow to create a root gh-pages
branch. It is based on a question at [SO]
cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
/** | |
* Converts a string to a "URL-safe" slug. | |
* Allows for some customization with two optional parameters: | |
* | |
* @param {string} Delimiter used. If not specified, defaults to a dash "-" | |
* @param {array} Adds to the list of non-alphanumeric characters which | |
* will be converted to the delimiter. The default list includes: | |
* ['–', '—', '―', '~', '\\', '/', '|', '+', '\'', '‘', '’', ' '] | |
*/ | |
if (!String.prototype.slugify) { |
module Main where | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Lazy as BL | |
import Data.Binary.Strict.Get | |
import qualified Data.Binary.Strict.BitGet as BG | |
import Data.Word | |
import Control.Monad | |
import Control.Applicative | |
import Data.Binary.Put |
// Twitter Issue (Can't tweet exclamation mark with v1.1) | |
// https://dev.twitter.com/discussions/12378 | |
// https://github.com/mikeal/request/issues/578 | |
var escape = function(str) { | |
return encodeURIComponent(str).replace(/[!*()']/g, function(character) { | |
return '%' + character.charCodeAt(0).toString(16); | |
}); | |
}; |
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
angular.module('demo').service('imageService', function ($http, $q, $timeout) { | |
var NUM_LOBES = 3 | |
var lanczos = lanczosGenerator(NUM_LOBES) | |
// resize via lanczos-sinc convolution | |
this.resize = function (img, width, height) { | |
var self = { } | |
self.type = "image/png" | |
self.quality = 1.0 |
class Main { | |
static function main() { | |
Sdl.init(Sdl.INIT_EVERYTHING); | |
var win = Sdl.createWindow("Hello", 100, 100, 800, 600, Sdl.WINDOW_OPENGL); | |
var ren = Sdl.createRenderer(win, -1, Sdl.RENDERER_ACCELERATED); | |
var bmp = Sdl.loadBMP("test.bmp"); | |
var tex = Sdl.createTextureFromSurface(ren, bmp); | |
Sdl.freeSurface(bmp); | |
for (i in 0...3) { |
var XLSX = require('xlsx') | |
function Workbook() { | |
this.SheetNames = ['Report']; | |
this.Sheets = {}; | |
} | |
var wb = new Workbook(); | |
var ws = { |
// This is my approach to creating callable objects | |
// that correctly reference their object members, | |
// without messing with prototypes. | |
// A Class that extends Function so we can create | |
// objects that also behave like functions, i.e. callable objects. | |
class ExFunc extends Function { | |
constructor() { | |
// Here we create a dynamic function with `super`, | |
// which calls the constructor of the parent class, `Function`. |
// Imagine you want to explicitly define which members of a public API | |
// interface your implementation actually uses. Example: you implement | |
// a web extension, but only use a few of the members on the argument | |
// to the onHeadersReceived handler. Explicitly typing this is useful | |
// when creating mocks in your unit tests. | |
// | |
// Here's now you could do it: | |