Skip to content

Instantly share code, notes, and snippets.

@collinglass
collinglass / .pagevue.js
Last active September 1, 2019 09:33
Simple Multi-View Routing with Page.js and Vue.js
Simple Multi-View Routing with Page.js and Vue.js
@mattia72
mattia72 / FullPie.md
Last active August 22, 2019 16:19 — forked from stevenleeg/pie.coffee
This is a simple widget that lets you render pie charts in Dashing.

FullPie widget

This is a simple widget that lets you render pie charts in Dashing. Forked from stevenleeg/pie.coffee It looks a little bit like this:

Screenshot

Usage

dashboard.erb:

@hubgit
hubgit / project-gutenberg-fetch-html.sh
Last active March 2, 2017 10:33
Fetch all HTML books from Project Gutenberg
#!/bin/bash
URL='http://www.gutenberg.org/robot/harvest?filetypes[]=html&langs[]=en'
REFERER='http://www.gutenberg.org/wiki/Gutenberg:Information_About_Robot_Access_to_our_Pages'
USER_AGENT='Gutenberg Importer'
wget --wait 10 --mirror --span-hosts --referer="$REFERER" --user-agent="$USER_AGENT" "$URL"
@mindplay-dk
mindplay-dk / TestServer.php
Last active November 20, 2019 12:23
Minimal (copy and paste) unit testing
<?php
/**
* This class will launch the built-in server in PHP 5.4+ in the background
* and clean it up after use.
*/
class TestServer
{
/**
* @var resource PHP server process handle
@ajaxray
ajaxray / cookies.js
Created November 24, 2012 12:01
Small JavaScript class to help create, read and delete cookie.
/**
* Cookies - A small class to manipulate cookies from javascript
*
* Compressed version: https://gist.github.com/4147384
*
* @see www.quirksmode.org/js/cookies.html
* @author Anis uddin Ahmad <anisniit@gmail.com>
*/
window.Cookies = {
@stilliard
stilliard / jsonToTable.php
Created October 9, 2012 13:24
JSON to HTML table
<?php
/**
* JSON data to html table
*
* @param object $data
*
*/
function jsonToTable ($data)
{
@ssokolow
ssokolow / index.php
Created July 6, 2012 03:39
Basic stub for mod_rewrite-like behaviour using PHP 5.4's development server
<?php
// To the extent possible under law, I (Stephan Sokolow) waive all copyright and related or
// neighbouring rights to this code snippet. (Though it'd still be nice if you mention me)
// If we're running under `php -S` with PHP 5.4.0+
if (php_sapi_name() == 'cli-server') {
// Replicate the effects of basic "index.php"-hiding mod_rewrite rules
// Tested working under FatFreeFramework 2.0.6 through 2.0.12.
$_SERVER['SCRIPT_NAME'] = str_replace(__DIR__, '', __FILE__);