Skip to content

Instantly share code, notes, and snippets.

View ahdinosaur's full-sized avatar
☀️
abundant

Mikey ahdinosaur

☀️
abundant
View GitHub Profile
@mattmccray
mattmccray / router.js
Last active December 26, 2015 14:29
Simple Backbone/Exoskeleton Router for use with React (http://facebook.github.io/react/)
var _missing= function(data){ return React.DOM.pre(null, "Route not found: "+ data.route) },
_router= null,
_started= false,
_nextId= 1;
function handleRouteChange(container, component) {
var routeParams= Array.prototype.slice.call( arguments, 1 )
React.renderComponent(
component({ routeParams:routeParams }, null),
container
@SaneMethod
SaneMethod / jquery-ajax-blob-arraybuffer.js
Last active March 14, 2022 17:57
Ajax transports to allow the sending/receiving of blobs and array buffers via the familiar jquery ajax function.To send, set data to the blob or arraybuffer to be sent, and add 'processData:false' to the ajax options.To receive, specify the 'dataType' as blob or arraybuffer in the ajax options.
(function($){
/**
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
*
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
* potentially any request with any dataType might want to use the transports provided herein.
*
@medikoo
medikoo / dbjs-persistent-layer-handler.js
Last active August 29, 2015 14:02
dbjs persistent layer handler
'use strict';
var Database = require('dbjs')
, serialize = require('dbjs/_setup/serialize/value')
, unserialize = require('dbjs/_setup/unserialize/value')
, DbjsEvent = require('dbjs/_setup/event')
, db = new Database();
// 1. Save
@tcr
tcr / beaglebone-instructions.md
Last active February 16, 2016 10:59
Creating a reusable Beaglebone Debian Image
@Raynos
Raynos / click-event.js
Created August 31, 2014 05:43
Mercury router
module.exports = clickEvent;
function clickEvent(handler, opts) {
opts = opts || {};
return function clickHandler(ev) {
if (!opts.ctrl && ev.ctrlKey) {
return;
}
@DamonOehlman
DamonOehlman / PAGE-SCRIPTS.md
Last active July 30, 2021 01:34
Interesting webpage injection scripts

Youtube -> Imgur Screenshot Helper (copy and paste into your browser console when on a video site)

var clientId = ''; // insert your imgur application client id here
var videos = document.getElementsByTagName('video'), canvas = document.createElement('canvas'), context = canvas.getContext('2d'), http = new XMLHttpRequest();
canvas.width = videos[0].videoWidth; canvas.height = videos[0].videoHeight;
context.drawImage(videos[0], 0, 0);

var data = JSON.stringify({
  image: canvas.toDataURL('image/jpeg', 0.9).split(',')[1]
@ericelliott
ericelliott / essential-javascript-links.md
Last active November 8, 2024 17:29
Essential JavaScript Links
@reqshark
reqshark / lxc.sh
Last active January 1, 2022 04:25
set up linux containers with node.js
# update the host
apt-get update && apt-get upgrade -y # && apt-get dist-upgrade -y && apt-get autoremove --purge -y && apt-get autoclean -y
# https://www.stgraber.org/
# install linux containers
sudo apt-get install lxc
# list all containers and view their current status
sudo lxc-ls -f
@davidhund
davidhund / pragmatic-touch-icons.md
Last active November 6, 2024 14:26
Pragmatic Touch Icons

NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.

I'd like to hear how you approach this: @valuedstandards or comment on this gist.

The issue

You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':

![Touch Icon Links](https://o.twimg.com/2/proxy.jpg?t=HBj6AWh0dHBzOi8vcGhvdG9zLTYuZHJvcGJveC5jb20vdC8yL0FBRGFGY1VRN1dfSExnT3cwR1VhUmtaUWRFcWhxSDVGRjNMdXFfbHRJWG1GNFEvMTIvMjI3OTE2L3BuZy8xMDI0eDc2OC8yL18vMC80L1NjcmVlbnNob3QlMjAyMDE1LTA0LTE0JTIwMTYuNTYuMjYucG5nL0NNejBEU0FCSUFJZ0F5Z0JLQUkvNGR1eDZnMzZmYnlzYWI3

@dominictarr
dominictarr / .travis.yml
Last active July 23, 2024 17:40
pull-streams crash course
language: node_js
node_js:
- '0.10'
- '0.12'