Skip to content

Instantly share code, notes, and snippets.

View danlamanna's full-sized avatar
🏠
Working from home

Dan LaManna danlamanna

🏠
Working from home
View GitHub Profile
class system_update {
exec { 'apt-get update':
command => 'apt-get update',
}
$sysPackages = [ "build-essential", "curl" ]
package { $sysPackages:
ensure => "installed",
require => Exec['apt-get update'],
package main
import (
"fmt"
"sort"
)
const (
SUPPORT int = 2
)
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import savefig
G = nx.Graph()
G.add_edges_from(
[('A', 'B'), ('A', 'C'), ('D', 'B'), ('E', 'C'), ('E', 'F'),
('B', 'H'), ('B', 'G'), ('B', 'F'), ('C', 'G')])
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MIN_TRANSACTION_NUM 2
typedef struct transaction {
char *items[MIN_TRANSACTION_NUM];
} transaction;
from datetime import datetime
import os, operator, sys
from optparse import OptionParser
def median(l):
sorts = sorted(l)
length = len(sorts)
if not length % 2:
return (sorts[length / 2] + sorts[length / 2 - 1]) / 2.0
return sorts[length / 2]
Systems ProgrammingCSI-402RaviBusiness LawLAW-220EvansOperations ResearchMSI-430KimIndependent StudyCSI-497Keller
import sys, struct, csv
schema = []
with open("test.schema", "r") as infile:
for line in infile:
schema.append(line.split())
with open("test.data", "r") as datafile:
reader = csv.reader(datafile, delimiter=',', quotechar='"')
#!/bin/bash
for file in $(find . -type f -name "*.c");
do
deps=$(grep '#include ' $file | grep -v '<' | awk -F'"' '{ printf("%s ", $2); }' | xargs)
outfile=`echo $file | sed 's/\.c/\.o/' | sed 's/\.\///'`
echo $outfile ": " $deps | sed 's/\ \:\ /:/'
done;
(setq hippie-expand-try-functions-list
'(yas/hippie-try-expand
try-complete-file-name-partially
try-expand-all-abbrevs
try-expand-dabbrev
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))
(require 'cl)
(setq org-agenda-files (remove-if-not 'file-exists-p '("file1" "file2")))