Skip to content

Instantly share code, notes, and snippets.

View samajammin's full-sized avatar
🏗️
Under construction

Sam Richards samajammin

🏗️
Under construction
View GitHub Profile
@samajammin
samajammin / singly_linked_list.py
Last active August 29, 2015 14:21
Sorted Singly Linked List | Python Implementation
class Node(object):
def __init__(self, initdata):
self._data = initdata
self._next = None
@property
def data(self):
return self._data
@samajammin
samajammin / doubly_linked_list.py
Created May 20, 2015 15:48
Sorted Doubly Linked List | Python Implementation
class Node(object):
def __init__(self, initdata):
self._data = initdata
self._next = None
self._prev = None
@property
def data(self):
return self._data
@samajammin
samajammin / hash_table.py
Created May 20, 2015 19:28
Hash Table (Map) | Python Implementation
class KeyValue(object):
def __init__(self, key, val):
self._key = key
self._val = val
@property
def key(self):
return self._key
@property
"""
2) What 10 IP addresses made the most requests in a log file "LOG.txt"
with format:
IP PATH RESPONSE_CODE
as in:
=====================
72.249.126.142 /*/http://elementvillage.com 404
72.136.174.175 /*/http://www.1234-find-web-designers.org 200
"""
1) Given the following shell transcript, write the program
"split-to-files" in any language of your choosing.
=====================
~$ ls -l
total 0
~$ head ../input.txt
@samajammin
samajammin / neighborly-org-markup.html
Created October 22, 2015 19:24
Neighborly Org JSON-LD Schema Markup
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Organization",
"name" : "Neighborly",
"url" : "https://neighborly.com",
"logo" : "https://ddth8v70o63jx.cloudfront.net/assets/logo_fb-3970ca6426fd27b2e7115248811ac5db79743fbd1d487a69d790a46275a9fe88.png",
"sameAs" : [
"https://www.facebook.com/neighborly",
"https://twitter.com/Neighborly",
function flatten(arr, newArr=[]){
console.log(arr)
// loop through each item
// for (i of arr) {
arr.forEach(function(i){
// check if item is an array,
if(Array.isArray(i)){
// if true, access array, call again
flatten(i, newArr)
} else {
const _ = require('lodash');
function saySomething(something) {
console.log(something)
}
function before(n, func) {
let result;
return function() {
if (--n > 0) {
#!/usr/bin/env bash
# $ code-insiders --list-extensions | xargs -L 1 echo code-insiders --install-extension
code-insiders --install-extension akamud.vscode-theme-onedark
code-insiders --install-extension akamud.vscode-theme-onelight
code-insiders --install-extension bung87.rails
code-insiders --install-extension bung87.vscode-gemfile
code-insiders --install-extension cduruk.thrift
code-insiders --install-extension dhedgecock.ember-syntax
code-insiders --install-extension eamodio.gitlens