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
/* | |
Pong.pde: The classic game "Pong" written in Processing | |
Author: Palmer Paul | |
Email: pzpaul2002@yahoo.com | |
Twitter: @pzp1997 | |
Version: 1.0.0 (10/29/14 07:25) | |
Copyright: (c) 2014, Palmer Paul | |
*/ | |
float p1, p2; |
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
var nextTimerId = 0 | |
var timerRegistry = [Int: Timer]() | |
let setInterval: @convention(block) (JSValue, Double) -> Int = { (function, interval) in | |
let timer = Timer.scheduledTimer(timeInterval: interval / 1000.0, repeats: true, action: { (timer) in | |
function.call(withArguments: []) | |
}) | |
let timerId = nextTimerId | |
timerRegistry[timerId] = timer |
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
javascript:(function(){document.querySelector('video').playbackRate=parseFloat(prompt('Set the playback speed')||1)})() | |
javascript:(function(){clearInterval(window.autoscrollerBookmarkTimerID);var s=parseFloat(prompt('Set the scroll frequency in ms'));if(s){window.autoscrollerBookmarkTimerID=setInterval(function(){window.scrollBy(0,1)},s)}})() | |
javascript:(function(){document.head.appendChild(document.createElement("style")).innerText="html,img,video{-webkit-filter:invert(1)hue-rotate(180deg);filter:invert(1)hue-rotate(180deg)}body{background:#000}"})() | |
javascript:(function(){if(window.debugBordersStyleNode){document.head.removeChild(window.debugBordersStyleNode);window.debugBordersStyleNode=undefined}else{window.debugBordersStyleNode=document.createElement("style");window.debugBordersStyleNode.innerText="*{border:1px solid red}";document.head.appendChild(window.debugBordersStyleNode)}})() | |
javascript:!function(d)%7Bd.head.appendChild(d.createElement(%27style%27)).innerText%3D%27html,img,video%7B-webkit-filte |
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
module LinkFilter | |
def gen_link(link) | |
if link.start_with?('http://', 'https://', '#') | |
link | |
elsif link.start_with?('site.data.links.') | |
desired_link = link.slice('site.data.links.'.length, link.length) | |
@context.registers[:site].data['links'][desired_link] | |
else | |
baseurl = @context.registers[:site].baseurl | |
jekyll_link = Jekyll::Tags::Link.send( |
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
module Main exposing (main) | |
import Html | |
windows : List a -> List ( a, a ) | |
windows list = | |
case list of | |
x :: ((y :: _) as xs) -> | |
( x, y ) :: windows xs |
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
data Can.Def | |
= Def (A.Located Name) [Pattern] Can.Expr | |
| TypedDef (A.Located Name) FreeVars [(Pattern, Type)] Can.Expr Type | |
data Can.Decls | |
= Declare Can.Def Can.Decls | |
| DeclareRec Can.Def [Can.Def] Can.Decls | |
| SaveTheEnvironment | |
data ModuleName.Canonical = |
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
public class EuclidAglo { | |
// cd(x, y, z) <==> (x % z == 0) && (y % z == 0) | |
// gcd(x, y, z) <==> cd(x, y, z) && (\forall int k;; cd(x, y, k) ==> k <= z) | |
//@ requires true; | |
//@ ensures (x % \result == 0) && (y % \result == 0) && (\forall int k;; (x % k == 0) && (y % k == 0) ==> k <= \result); | |
public static int run(int x, int y) { | |
int n = x; | |
int m = y; | |
//@ maintaining (\forall int z;; ((x % z == 0) && (y % z == 0) && (\forall int k;; (x % k == 0) && (y % k == 0) ==> k <= z)) <==> ((n % z == 0) && (m % z == 0) && (\forall int k;; (n % k == 0) && (m % k == 0) ==> k <= z))); |
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
#!/usr/bin/env python2.7 | |
"""Discovers who unfollowed you on Instagram (and unfollows those people).""" | |
import json | |
from webbrowser import open_new_tab | |
from urllib2 import urlopen, URLError | |
from urlparse import urlparse | |
from time import time | |
from os import rename |
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
// COUNTERS FOR INSTRUMENTATION | |
var refEqSkippedNodes, refEqSkippedDescendants; | |
function _VirtualDom_diff(x, y) | |
{ | |
var patches = []; | |
refEqSkippedNodes = 0; | |
refEqSkippedDescendants = 0; | |
_VirtualDom_diffHelp(x, y, patches, 0); |
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
var canvasWidth = 500; | |
var canvasHeight = 500; | |
var g = 0.04; | |
var playerWidth = 30; | |
var playerHeight = 50; | |
var gameState = "start"; | |
var playerX, projectile, balls, numArrowsUsed, startTime, timeElapsed; | |
reset(); |
NewerOlder