This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style type="text/css"> | |
#grid-container { | |
display: grid; | |
grid-template-columns: repeat(4, 1fr); /* Creates four equal columns */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* globals importScripts, workbox */ | |
// https://developers.google.com/web/fundamentals/primers/service-workers/ | |
// https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading | |
// https://developers.google.com/web/tools/workbox/modules/workbox-sw#using_workbox_sw_via_cdn | |
importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js'); | |
if (workbox) { | |
console.log(`Yay! Workbox is loaded 🎉`); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# REQUIRES: | |
# - server (the forge server instance) | |
# - site_name (the name of the site folder) | |
# - sudo_password (random password for sudo) | |
# - db_password (random password for database user) | |
# - event_id (the provisioning event name) | |
# - callback (the callback URL) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Request permission to receive notifications via dialog | |
messaging.requestPermission().then(function(result) { | |
// Permission granted. | |
messaging.getToken().then(function(currentToken) { | |
// Got IID. Persist to server and track state in localStorage | |
var persistedIID = localStorage.getItem('messaging.persistedIID'); | |
if (persistedIID != currentToken) { | |
$.post('/iid', {'iid': currentToken}, function() { | |
localStorage.setItem('messaging.persistedIID', currentToken); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://gist.github.com/aleemb/97b4f5f8510f397c4a08 | |
-- V3 | |
-- http://dougscripts.com/itunes/scripts/ss.php?sp=copytinforackstotracks | |
-- http://dougscripts.com/itunes/itinfo/info03.php | |
set root to "/Users/aleemb/Music/aleem" | |
set musicExtensions to {"mp3", "m4a"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace CommonMark; | |
use CommonMark\Inline\Processor\YouTubeVideoProcessor; | |
use CommonMark\Inline\Renderer\YouTubeVideoRenderer; | |
use League\CommonMark\Converter; | |
use League\CommonMark\Environment; | |
use League\CommonMark\DocParser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Suggestions</title> | |
<style> | |
#menu { | |
margin: 0; | |
width: 200px; | |
display: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## calculate the probability of server winning a single game, | |
## given p(winning single point) and current point score | |
## some results and commentary here: | |
## http://summerofjeff.wordpress.com/2010/12/03/single-game-win-expectancy-tables/ | |
def fact(x): | |
if x in [0, 1]: return 1 | |
r = 1 | |
for a in range(1, (x+1)): r = r*a |