Skip to content

Instantly share code, notes, and snippets.

View theunraveler's full-sized avatar

Jake Bell theunraveler

  • University of Minnesota
  • Minneapolis, MN
View GitHub Profile
BEGIN MESSAGE.
N7Df9ksOeJJwMQp 6IzW6GcI8Qauoat IWnqYQwNY8Y8iIC HokxbOEcMt5cIND
8MR5ouIS4ky48IW uufKoZvB3F5TCKq 6Xr2MZHgg6PZhM9 XHlY0TwnaT1W1yh
uUi0UlFO0D8KMOx EAS3lsBvUsEbHBO m7DVAFarOHR654y TXwlctwN78KHWP8
lJzXg3yh7lZBdqG czL5Tmxjnp6zgzq zvvqZ2BwlTVlNtt .
END MESSAGE.
array_filter($input, $callback);
array_map($callback, $input);
strpos($haystack, $needle);
array_search($needle, $haystack);
defmodule Prime do
@doc """
Generates the nth prime.
"""
@spec nth(non_neg_integer) :: non_neg_integer
def nth(n) when n < 1, do: raise :error
def nth(n) do
Stream.iterate(2, &(&1 + 1))
|> Stream.filter(&prime?/1)
|> Enum.at(n - 1)
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'pg'
end
conn = PG.connect( dbname: 'paranoia_null_unique' )
@theunraveler
theunraveler / slack_notifier.py
Created September 2, 2014 14:47
Slack Notifier
import httplib, json
import getopt, sys, os
import subprocess
def get_connection(organization):
return httplib.HTTPSConnection('%s.slack.com' % organization)
def get_url(token):
return '/services/hooks/incoming-webhook?token=%s' % token
@theunraveler
theunraveler / php_file.php
Created March 11, 2011 03:38
DO NOT DELETE: Testing for Gist Filter Drupal module.
<?php
echo 'Hello!';
?>