Read the full blog post at: http://jcla1.com/blog/on-ulam-spirals-and-matrix-generation/.
This file contains hidden or 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
SECOND = 1 | |
MINUTE = 60 * SECOND | |
HOUR = 60 * MINUTE | |
time = Time.new 0, 1, 1, 0, 0 | |
end_time = Time.new 0, 1, 2, 0, 0 | |
$coincidences = [] | |
class Time |
This file contains hidden or 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> | |
<body> | |
<div id="main"> | |
<ul> | |
<li><b>Anteater</b></li> | |
<li><a href="b.html">Baobao</a></li> | |
<li><a href="c.html">Cuttlefish</a></li> | |
</ul> | |
Anteaters, also known as antbear, are the four mammal species of the suborder Vermilingua (meaning "worm tongue") commonly known for eating ants and termites. Together with the sloths, they compose the order Pilosa. The name "anteater" is also colloquially applied to the unrelated aardvark, numbat, echidna, and pangolin. |
This file contains hidden or 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
import math | |
def total_cost(amount): | |
return int(math.ceil(amount + 0.5 + 0.01 * amount)) | |
def reduce_balance(balance, amount): | |
if amount < balance: | |
balance -= total_cost(amount) | |
return balance |
This file contains hidden or 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
package main | |
import ( | |
"encoding/json" | |
"net/http" | |
) | |
type Turn struct { | |
Stack []string `json:"stack"` | |
Hand []string `json:"hand"` |
This file contains hidden or 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
#!/bin/sh | |
# computer activity data collection for http://jehiah.cz/one-two/ | |
# initially by Jehiah Czebotar. Modified by Joseph Adams | |
FILE="data/misc/activity_log/`date +%Y%m%d`.log" | |
FRONT_APP="data/misc/cron/frontApp/frontApp.applescript" | |
function log_activity() | |
{ | |
local UTC=`date "+%s,%Z"` |
This file contains hidden or 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
tell application "System Events" | |
set chromeRunning to (length of (get name of every process whose name is "Google Chrome") is greater than 0) | |
set chromeInFocus to ((name of first application process whose frontmost is true) is "Google Chrome") | |
set activeURL to "" | |
set numTabs to 0 | |
if chromeRunning then | |
tell application "Google Chrome" | |
set normalWindows to (windows whose mode is not "incognito") |
This file contains hidden or 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
tell application "System Events" | |
set programs to get name of every process whose background only is false and name is not "Finder" | |
set AppleScript's text item delimiters to {","} | |
programs as string | |
end tell |
This file contains hidden or 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
[submodule "running_programs"] | |
path = running_programs | |
url = https://gist.github.com/6554497.git | |
[submodule "chrome_status"] | |
path = chrome_status | |
url = https://gist.github.com/6525572.git | |
[submodule "frontApp"] | |
path = frontApp | |
url = https://gist.github.com/6522769.git |
This file contains hidden or 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
PSH 0 | |
PSH 1 | |
LOOP: SUM 2 | |
OUT | |
DUP | |
JMP EO_CHECK | |
EO_CONT: OUT | |
POP | |
SSZ | |
PSH 20 |