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
@dcalacci
dcalacci / .bash_profile
Created September 6, 2012 23:48
bash_profile
# Added by install_latest_perl_osx.pl
[ -r /Users/Dan/.bashrc ] && source /Users/Dan/.bashrc
[[ -s "/Users/Dan/.rvm/scripts/rvm" ]] && source "/Users/Dan/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
## PATH variables
export PATH="$HOME/bin/Racket\ v5.2.1/bin/:$PATH" # Racket
export PATH=/Users/Dan/bin/google/android-sdk-macosx/tools/:$PATH #Android development
alias mips='java -jar /Users/Dan/Dropbox/work/classes/cs2600/assembly/Mars_4_1.jar' #MIPS emulator (MARS)
function git_prompt() {
@dcalacci
dcalacci / easyjava
Created September 10, 2012 17:52 — forked from nixpulvis/easyjava
Simple and Easy way to run a java class.
#!/usr/bin/env ruby
# ## An Easy Way to Compile and Run Java Classes
#
# System utility for compiling and running Java classes
# in a specific directory structure.
#
# #### Recommended Installation
# Save this code to a file named `easyjava`, somewhere on your HD. Then
# in your `~/.bash_profile` add the following:
@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 "
@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 / 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 / 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 / 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 / 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 / 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 / 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