Skip to content

Instantly share code, notes, and snippets.

View j-f1's full-sized avatar
🥁
Instruments/profiling tools @apple

Jed Fox j-f1

🥁
Instruments/profiling tools @apple
View GitHub Profile
@nateps
nateps / gist:1172490
Created August 26, 2011 01:38
Hide the address bar in a fullscreen iPhone or Android web app
<!DOCTYPE html>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name=apple-mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=black>
<title>Test fullscreen</title>
<style>
html, body {
margin: 0;
padding: 0;
@lemieuxster
lemieuxster / Bookmarkified
Created May 2, 2012 18:37
QR Code Bookmarklet
javascript:(function(window, document, undefined) {try {var selectedText = document.getSelection().toString(); if (selectedText === ''){selectedText = window.location.href;} if(selectedText !== ''){var baseQRUrl = 'http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=' + encodeURIComponent(selectedText); window.open(baseQRUrl, '_blank', 'width=400,height=400');}} catch (e) {}})(window, document);
@domenic
domenic / event-emitter.js
Last active March 11, 2022 15:25
Revealing constructor pattern event-emitter
// This event emitter emits events, but reserves the right to publish events to
// for its creator. It uses a WeakMap for true encapsulation.
const eesToEventMaps = new WeakMap();
export default class EventEmitter {
constructor(publisher) {
const eventMap = Object.create(null);
eesToEventMaps.set(this, eventMap);
const attributeExceptions = [
`role`,
];
function appendText(el, text) {
const textNode = document.createTextNode(text);
el.appendChild(textNode);
}
function appendArray(el, children) {
@travisjj
travisjj / topbarhover.js
Created February 9, 2017 20:38
Keeps the topbar open, also opens on hover
$('.secondary-nav a.-link').each(function(){this.removeAttribute("title");});
var btns = [];
var achieve = { btn: 'a.-link.js-achievements-button', mod: '.topbar-dialog.achievements-dialog.dno' };
btns.push(achieve);
var inbox = { btn: 'a.-link.js-inbox-button', mod: '.topbar-dialog.inbox-dialog.dno' };
btns.push(inbox);
var se = { btn: 'a.-link.js-site-switcher-button.js-gps-track', mod: '.topbar-dialog.siteSwitcher-dialog.dno' };
btns.push(se);
for( var ind in btns ){
var tar = btns[ind].btn;
@vzsg
vzsg / revert-github-header.user.js
Created February 10, 2017 22:36
Userscript to revert GitHub header to the light version
// ==UserScript==
// @name Revert GitHub theme
// @namespace https://github.com
// @version 0.1
// @description try to take over the world!
// @author vzsg
// @match https://*.github.com/*
// @grant none
// ==/UserScript==

Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?

title = "TOML Example"

[owner]

@AWegnerGitHub
AWegnerGitHub / Helios.md
Last active November 22, 2017 02:46
Helios proposal and architechture discussion for a centrally managed database for SmokeDetector

A Redux Story

Developer: "Doo Doo Doo... Working on the new Redux rewrite. Gotta write some fetch actions..."

FETCH_USERS -> function fetchUsersAction() {...}
FETCH_PAGES -> function fetchPagesAction() {...}
FETCH_FRIENDS -> function fetchFriendsAction() {...}
FETCH_GROUPS -> function fetchGroupsAction() {...}
FETCH_EVENTS -> function fetchEventsAction() {...}