Skip to content

Instantly share code, notes, and snippets.

@sebjacobs
sebjacobs / LinkedList.ts
Created January 13, 2020 23:49
Sortable LinkedList. It is worth noting that the swap function kind of cheats because it only swaps the data and not the actual nodes
import { Sortable } from "./Sortable";
class Node {
constructor(public data: number, public next: Node | null = null) {}
}
export class LinkedList implements Sortable {
head: Node | null = null;
constructor() {}

Keybase proof

I hereby claim:

  • I am sebjacobs on github.
  • I am sebjacobs (https://keybase.io/sebjacobs) on keybase.
  • I have a public key whose fingerprint is CD4B FAE8 DBD7 B892 84BA 43AB 31EB 651D A292 3774

To claim this, I am signing this object:

update
upgrade
tap homebrew/dupes
# install cask
install ack
install git
install imagemagick --with-webp
@sebjacobs
sebjacobs / enable_s3_mfa.rb
Last active April 19, 2016 04:25
Enable S3 MFA
require 'aws-sdk'
access_key = 'ACCESS-KEY'
secret_key = 'SECRET-KEY'
s3 = AWS::S3.new(
access_key_id: access_key,
secret_access_key: secret_key,
region: 'eu-west-1'
)
@sebjacobs
sebjacobs / .gitignore
Created September 2, 2014 21:47
Android gitignore
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
@sebjacobs
sebjacobs / chef_solo_bootstrap.sh
Last active December 15, 2015 16:59 — forked from tjsingleton/Chef Solo Bootstrap with Ruby 2.2.2
Chef Solo Bootstrap with Ruby 2.0.0-p0
#!/usr/bin/env bash
apt-get -y update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
apt-get -y install autoconf curl git-core bzip2
apt-get -y autoremove
apt-get -y clean
cd /usr/local/src
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz
@sebjacobs
sebjacobs / asset_helper.rb
Created November 6, 2012 14:29
AssetHelper
module AssetHelper
def figure_tag(content_type, content_urls=[], caption, options={})
case content_type
when :image
content = image_tag(content_urls.first, srcset: content_urls.join(','), alt: options[:alt])
when :video
content = video_tag(content_urls.first, alt: options[:alt], controls: true)
end
content += content_tag(:figcaption, caption)
content_tag :figure, content
@sebjacobs
sebjacobs / sphinx0981.rb
Created January 31, 2012 10:14
sphinx 0.981 formula for homebrew
require 'formula'
class Sphinx0981 <Formula
url 'http://sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz'
homepage 'http://www.sphinxsearch.com'
md5 '428a14df41fb425e664d9e2d6178c037'
head 'http://sphinxsearch.googlecode.com/svn/trunk/'
def install
fails_with_llvm "fails with: ld: rel32 out of range in _GetPrivateProfileString from /usr/lib/libodbc.a(SQLGetPrivateProfileString.o)"
import java.io.Console;
/*
Cryptography and Internet Security - Worksheet 1
Seb Jacobs
This class encrypts and decrypts a plaintext message using a substitution cipher.
The key for this substitution cipher is derived from a keyphrase provided by the user.
All the spaces and duplicate letters are removed from the keyphrase.
import java.io.Console;
public class SubCipher{
private String keyPhrase,keyCipher;
public String alphabet="";
public SubCipher(String key){
keyCipher="";