Skip to content

Instantly share code, notes, and snippets.

View Ultrabenosaurus's full-sized avatar

Dan Bennett Ultrabenosaurus

  • UK
View GitHub Profile
jTypes('struct Color', function(red, green, blue)
{
this.red = red;
this.green = green;
this.blue = blue;
},
{
'public int red': 0,
'public int green': 0,
'public int blue': 0
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
# yolo
<input type="text" autofocus>
</body>
@dan-bennett
dan-bennett / aliases.sh
Last active August 29, 2015 14:05
my shell aliases
#!/bin/bash
# backup "<path>"
# create a new folder in the backups directory and dump the current directory's contents into it
backup(){
mkdir "/path/to/backups/$1";
cp -r . "/path/to/backups/$1";
}
# bs
@walkerstone
walkerstone / index.html
Created October 28, 2014 15:39
Single page template
<html>
<head>
<style>
html { height: 101%; }
body { margin: 0; padding: 0; font-family: sans-serif;}
h1, h2, h3 { margin: 0; }
a { font-weight: ; text-decoration: none; color: #586FB2;}
.active { background: #586FB2; color: white;}
@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
@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>
@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;