Skip to content

Instantly share code, notes, and snippets.

Making my way downtown

Brian Muhia poppingtonic

Making my way downtown
View GitHub Profile
View makehub
# Title
# Picture
media: undefined
# Objective
A way for kids to interact with pictures of animals that they recognize, in interesting ways.
# Duration
1-2 hours
# Age Group
View slack.clj
(ns slack
(:require [clj-http.client :as client]
[ :as json]))
(defn send-to-slack
"Sends a simple message to slack using an 'incoming webhook'.
url will be of form: .
(Exact url you should use will appear on the slack integration page)
text will be any valid message.
This implementation could be expanded if you wanted to specify channel, username, etc.
View gist:10444811
module Botworld where
import Control.Applicative ((<$>), (<*>))
import Control.Monad (join)
import Control.Monad.Reader (Reader, asks)
import Data.List (delete, elemIndices, intercalate, sortBy)
import Data.List.Split (chunksOf)
import Data.Maybe (catMaybes, isJust, fromMaybe, mapMaybe)
import Data.Ord (comparing)
import Text.Printf (printf)
View gist:10738381
// by dave @ >:)
void setup() {
result = new int[width*height][3];
result_ = new int[width*height][3];
int[][] result, result_;
float time;
View om_data.cljs
(ns om-data.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[datascript :as d]))
(def schema {})
(def conn (d/create-conn schema))
View rspec-syntax-cheat-sheet.rb
# RSpec 2.0 syntax Cheet Sheet by
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
poppingtonic / eshell-here.el
Created May 6, 2015
Open eshell in the current directory
View eshell-here.el
(defun eshell-here ()
"Opens up a new shell in the directory associated with the
current buffer's file. The eshell is renamed to match that
directory to make multiple eshell windows easier."
(let* ((parent (if (buffer-file-name)
(file-name-directory (buffer-file-name))
(height (/ (window-total-height) 3))
(name (car (last (split-string parent "/" t)))))
Please read original blog post for reference:
poppingtonic / parsel.sql
Created Mar 7, 2016
Parsel: A Simple Function for Parallel Query in Postgres using Dblink
View parsel.sql
-- DROP FUNCTION IF EXISTS public.parsel(db text, table_to_chunk text, pkey text, query text, output_table text, table_to_chunk_alias text, num_chunks integer);
CREATE OR REPLACE FUNCTION public.parsel(db text, table_to_chunk text, pkey text, query text, output_table text, table_to_chunk_alias text default '', num_chunks integer default 2)
sql TEXT;
min_id integer;
max_id integer;
step_size integer;
lbnd integer;
poppingtonic /
Created Jun 6, 2016 — forked from csvoss/
English to Tengwar transliterator
# This file converts English text to Tengwar, using my own personal
# preferences for transliterating Tengwar.
# Currently, the output that is created is intended for use with the Tengwar
# Annatar font and related font families.
# Example usage:
# >>> print convert("This was a triumph. I'm making a note here: huge success!")
# -- then paste the resulting text into a document rendered in Tengwar Annatar.