Skip to content

Instantly share code, notes, and snippets.

@codycoats
codycoats / .gitignore
Created September 17, 2019 03:29
React App Gitignore
node_modules
@codycoats
codycoats / app.yaml
Created December 10, 2013 19:49 — forked from darktable/app.yaml
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@codycoats
codycoats / polaroid.css
Created April 16, 2013 15:15
Polaroid like styling for images
.polaroid{
background: #fff;
padding: 5px;
margin: 3px;
-webkit-box-shadow: 3px 3px 5px #333;
-moz-box-shadow: 3px 3px 5px #333;
box-shadow: 3px 3px 5px #333;
border-width: 3px;
}
@codycoats
codycoats / printArray.c
Created April 5, 2013 23:40
Print Array
void printArray(int array[], FILE* ofp)
{
fprintf(ofp, "Printing Array:\n");
int i;
int count = (sizeof(array)/sizeof(int));
fprintf(ofp, "\t");
for (i = 0; i < count; ++i)
{
fprintf(ofp, " [%i] = %i ", i, array[i]);
}
@codycoats
codycoats / addArrays.c
Last active December 15, 2015 19:59
Array Add. Adds the contents on array2 to the contents of array1. Arrays should be same size. If not: if array1 is size m and array2 is size n then only the first n integers of array2 will be added to array1.
int addArrays(int *array1, int *array2){
int count = (sizeof(array1)/sizeof(array1[0]))-1;
int i;
for (i = 1; i <= count; ++i)
{
array1[i] += array2[i];
}
return 0;
@codycoats
codycoats / catsolu
Created March 7, 2013 06:24
Cat all the answers into the solutions
for i in {1..7}
do
cat "uni/detailed$i-detailed.txt" "fcfs/detailed$i-detailed.txt" "rr/detailed$i-detailed.txt" "sjf/detailed$i-detailed.txt" > solutions/solutions-$i.txt
done
#!/bin/bash
folders=("fcfs" "rr" "sjf" "uni");
filetypes=("input" "output" "detailed" "show-random");
baseurl="http://cs.nyu.edu/~gottlieb/courses/os/labs/lab2/";
for folder in ${folders[@]}
do
mkdir $folder && cd $folder
for type in ${filetypes[@]}
@codycoats
codycoats / link-test
Created February 9, 2013 02:57
shell script to take input and compare with solution