Skip to content

Instantly share code, notes, and snippets.

View neonstalwart's full-sized avatar

Ben Hockey neonstalwart

  • google.com
  • Boulder, CO
View GitHub Profile
@necolas
necolas / Component.js
Created March 13, 2015 19:13
Leadfoot component objects example
'use strict';
/**
* Base component driver
*
* Related docs:
* https://theintern.github.io/leadfoot/Command.html
* https://theintern.github.io/leadfoot/Element.html
*
* @param {leadfoot/Command} remote

GitLab CE Omnibus installation using system nginx

Requirements

  • Ubuntu 14.04 LTS
  • Root or sudo access

Steps

  • Install git and nginx:
@bitinn
bitinn / README.md
Last active September 21, 2023 20:36
A soft-fullscreen prompt for iOS7+

A soft-fullscreen prompt for iOS7+

Background

iOS 7.0 and iOS 8 (Beta) do not have support for minimal-ui viewport keyword, nor do they response to window.slideTo(0,1) or support Fullscreen API, which means there is no easy way to tell Mobile Safari to hide address bar/menu without user interaction.

This is a problem for Web App that mimics Native App design, where html/body are commonly set to height: 100%, so browser viewport = available screen estate. There are currently no solution besides adding apple-mobile-web-app-capable meta and ask users to manually Save to Homescreen.

Frustrated by this limit, we present a soft-fullscreen prompt design, which, coupled with proper CSS hack, can achieve soft-fullscreen with relatively small effort from users.

@bryanforbes
bryanforbes / hostit.sh
Created October 15, 2012 14:56
hostit
# vim: set filetype=zsh:
if [[ $# -eq 0 ]]; then
echo "Usage: hostit [-l] [[-d -f] hostname]"
return
fi
REMOVE_HOST=0
FORCE_HOST=0
LIST_HOSTS=0
@Gozala
Gozala / Functional.md
Created September 14, 2012 21:39
List of good talks / posts outlinig benefits of functional over OOP
anonymous
anonymous / ui.js
Created August 8, 2012 13:24
Separating presentation vs behavior
collectionModel = /* could be from some model constructor with direct data array, from a query result, a URL, or whatever */
// first we bind the collectionModel to this TC, so there will be a child widget created for each item in the array
// the binding will handle observing the collection model for changes to add and remove children
bind(collectionModel, new TabContainer())
.forEach(function(item){ // called for each child
var cp = new ContentPane({}); // create the child widget to use (could be optional)
var form = cp.domNode; // get the domNode to attach the children
@bryanforbes
bryanforbes / adapt.js
Created June 20, 2012 18:19
Deferred adapter for node
define([
"dojo/Deferred"
], function(Deferred){
var slice = Array.prototype.slice;
return function adapt(func){
var args = slice.call(arguments, 1),
def = new Deferred;
args.push(function(err, value){
if(err){
@Raynos
Raynos / weak-map.js
Last active September 18, 2019 07:49 — forked from Gozala/weak-map.js
Harmony WeakMap shim for ES5
// Original - @Gozola. This is a reimplemented version (with a few bug fixes).
window.WeakMap = window.WeakMap || (function () {
var privates = Name()
return {
get: function (key, fallback) {
var store = privates(key)
return store.hasOwnProperty("value") ?
store.value : fallback
},
@phiggins42
phiggins42 / tunlr
Created November 11, 2011 15:05
tunlr!
#!/usr/bin/env node
/*
tunlr - simple SSH tunnel management
usage: tunlr [options] [command]
options:
-q quiet. suppress console output.