Skip to content

Instantly share code, notes, and snippets.

View dcalacci's full-sized avatar
🦩
wfh baby

Dana Calacci dcalacci

🦩
wfh baby
View GitHub Profile
-----BEGIN CERTIFICATE-----
MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE
ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT
B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB
nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR
fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW
8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG
A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE
CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG
@dcalacci
dcalacci / balls-gravity.elm
Last active December 17, 2015 23:39
falling balls that follow a simple gravitational model
import Random (randomize)
import Color (rgb)
import Time (every, inSeconds, seconds)
-- Pos represents an x,y position in the plane
data Pos = Pos Int Int
-- Vel represents an x,y velocity
data Vel = Vel Int Int
-- First parameter is radius
@dcalacci
dcalacci / smooth-follow.elm
Created June 1, 2013 14:44
smooth ball-following in elm
import Either
import Mouse
import Window
-- updates for movement
data Update = Click (Int,Int) | TimeDelta Time
-- control
-- merges the Click
@dcalacci
dcalacci / ball-animation-click.elm
Created June 1, 2013 14:31
animated ball moves to last clicked location
import Either
import Mouse
import Window
-- updates for movement
data Update = Click (Int,Int) | TimeDelta Time
-- control
input = let clickPos = sampleOn Mouse.clicks Mouse.position
@dcalacci
dcalacci / ball.elm
Created June 1, 2013 14:01
ball follows the mouse around
import Mouse
import Window
scene (x,y) (w,h) =
collage w h
[
circle 10 |> filled blue
|> move (x - toFloat w / 2, toFloat h / 2 - y)
]
@dcalacci
dcalacci / net.johnmacfarlane.gitit.plist
Created November 29, 2012 02:38 — forked from kowey/net.johnmacfarlane.gitit.plist
Edit and save in ~/Library/LaunchAgents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>WorkingDirectory</key>
<string>/Users/Dan/wiki/gitit/</string>
<key>KeepAlive</key>
<true/>
<key>EnvironmentVariables</key>
<dict>
@dcalacci
dcalacci / README.md
Created November 7, 2012 07:15 — forked from agnoster/README.md
My ZSH Theme

agnoster-light.zsh-theme

My own fork of agnoster, optimized for a terminal that uses the solarized-light colorscheme.

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
@dcalacci
dcalacci / hw4_execute.c
Created October 31, 2012 01:48
execute function from hw4.c
static void execute(int argc, char *argv[])
{
pid_t childpid; /* child process ID */
childpid = fork();
if (childpid == -1) { /* in parent (returned error) */
perror("fork"); /* perror => print error string of last system call */
printf(" (failed to execute command)\n");
}
if (childpid == 0) { /* child: in child, childpid was set to 0 */
@dcalacci
dcalacci / who-owes-who-what?
Created September 29, 2012 03:29
a racket script to determine how much a given person owes for groceries
;; a shopping trip is a
;; (make-shopping-trip string lon lon lon)
;; where name is the name of the trip
;; a is the list of items andrea should pay for
;; dj is the list of items dan and jansen should pay for
;; all is the list of items everyone should pay for
;; paid is the person who paid for the food
;;(not actually lists of items, rather, lists of prices)
(define-struct shopping-trip (name a dj all paid))
@dcalacci
dcalacci / factorial.asm
Created September 19, 2012 03:35
simple factorial program in MIPS assembly
.globl main
.data
msgprompt: .word msgprompt_data
msgres1: .word msgres1_data
msgres2: .word msgres2_data
msgprompt_data: .asciiz "Positive integer: "
msgres1_data: .asciiz "The value of factorial("
msgres2_data: .asciiz ") is "