Skip to content

Instantly share code, notes, and snippets.

View Ultrabenosaurus's full-sized avatar

Dan Bennett Ultrabenosaurus

  • UK
View GitHub Profile
@24flash
24flash / index.html
Created September 10, 2012 11:19
Text masked particles which spring up on mouse proximity.
<canvas id=c></canvas>
<span>Try disturbing the particles with mouse</span>
@mgronhol
mgronhol / notebook.py
Created September 10, 2012 11:25
Simple notebook with REST api using Flask
#!/usr/bin/env pytohn
from flask import Flask, request, jsonify, abort
import time
app = Flask( __name__ )
notes = {}
next_note_id = 0
@xeoncross
xeoncross / aloha-config.js
Created September 12, 2012 15:24 — forked from evo42/aloha-config.js
Aloha Editor -- send content via ajax to a backend php script to save the data edited with Aloha Editor
( function ( window, undefined ) {
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings = {
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true },
errorhandling: false,
ribbon: false,
locale: 'en',
floatingmenu: {
width: 630,
@ronnyhaase
ronnyhaase / formatTime.js
Last active October 10, 2015 15:47
Format time by hour of the day and minute of the hour
/**
* Returns formatted time depending on the clock (e.g. 00:00 / 12:00am)
* @param {number} hour - The hour of the day (0-24)
* @param {number} minute - The minute of the the hour (0-59)
* @param {string} clock - Either "12h" or "24h"
* @returns The time as a well formated string or false in case of an error
*/
function formatTime(hour, minute, clock) {
( minute < 10 )
? minute = '0' + minute
@cyrusbeer
cyrusbeer / application.js
Created September 13, 2012 11:58
Intercepts urls on your site and instead makes ajax calls and then changes the url shown in the browser with pushState to make it look like the original url was submitted.
$(function( $ ) {
$(document).ready(function() {
$(".ajax-intercept").ajaxInterceptor({
pageElementToUpdateSelector: "div#content",
showLoadingMessage: true,
loadingMessageDelay: 600,
loadingMessage: 'Loading...',
@thathollywood
thathollywood / chat-frontend.js
Created September 13, 2012 14:09 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@madsanton
madsanton / Default (Linux).sublime-keymap
Created September 18, 2012 13:30 — forked from coldnebo/Default (Linux).sublime-keymap
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@fitorec
fitorec / android.logo.html
Created September 19, 2012 09:13
logo android en puro HTML & CSS
<!DOCTYPE html>
<html lang="es-MX">
<head>
<title>logo android</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css" media="all">
#perspective-container { position: absolute; top: 0px; width: 264px; height: 336px; background-color: rgba(0,0,0,.05); -moz-transform-style: preserve-3d; -moz-perspective: 800px;}
#android { position: absolute; top: 0px; width: 264px; height: 336px;}
#android .body { position: absolute; top: 110px; left: 48px; width: 168px; height: 152px; border-radius: 0px 0px 30px 30px; background-color: #ED8415;}
#android .head { position: absolute; top: 30px; left: 48px; width: 168px; height: 68px; border-top-left-radius: 50% 100%; border-top-right-radius: 50% 100%; background-color: #ED8415; }
@damien-list
damien-list / gist:3749365
Created September 19, 2012 12:22
Input & Textarea Character Limit Display with jQuery
(function($) {
$.fn.extend( {
limiter: function(limit, elem) {
$(this).on("keyup focus", function() {
setCount(this, elem);
});
function setCount(src, elem) {
var chars = src.value.length;
if (chars > limit) {
src.value = src.value.substr(0, limit);
@xeoncross
xeoncross / gdrivecms.php
Created September 20, 2012 14:37 — forked from timwis/gdrivecms.php
GDriveCMS allows you to use Google Docs' familiar interface for adding content to a mobile-optimized web page. Simply create a Google Document with whatever content you want, publish it to the web (in the File menu), and render it through this script.
<?php
/* GDriveCRM
Created by Tim Wisniewski (timwis.com)
GDriveCMS allows you to use Google Docs' familiar interface for adding content to a mobile-optimized web page.
Simply create a Google Document with whatever content you want, publish it to the web (in the File menu),
and render it through this script.
1. Create a document in Google Drive (Google Docs)
2. Go to File > Publish to the web
3. Click Start Publishing & check Automatically republish
4. Grab the document link (URL) in that dialog