Skip to content

Instantly share code, notes, and snippets.

View leemeichin's full-sized avatar
:shipit:

Lee Meichin leemeichin

:shipit:
View GitHub Profile
@leemeichin
leemeichin / sphinx.rb
Last active May 12, 2016 14:06
Sphinx 0.9.9 OS X
require 'formula'
class Libstemmer < Formula
# upstream is constantly changing the tarball,
# so doing checksum verification here would require
# constant, rapid updates to this formula.
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz'
homepage 'http://snowball.tartarus.org/'
end
@leemeichin
leemeichin / README.md
Created October 9, 2012 16:11
Apply Standard Competition Rankings to your leaderboard

Standard Competition Rankings

This class makes it easier to generate a leaderboard that complies with the Standard Competition Ranking system. That is, it takes joint/tied positions into account, and adjusts the positions accordingly.

Take the following list of users and points for example:

User    | Points
1         35
2         35
@leemeichin
leemeichin / termwidth.kak
Created December 20, 2016 21:12
Break lines at terminal width
hook buffer InsertChar [^\n] %sh{
echo exec -draft "gh<a-k>.{$(tput cols),}<ret><a-;>bi<ret><esc>"
}
return botBuilder(function (req, ctx) {
var date = chrono.parse(req.text)
var yearMonthDay = parseTheDate(date[0].start.date()) # make a YYYY-MM-DD string
var message = new SlackTemplate()
.channelMessage(true)
.replaceOriginal(true)
message.addConfirmation(
'Just double checking!',
"I'm going to look for awesome sauces for *" + date[0].text + '*, is that right?',
var botBuilder = require('claudia-bot-builder')
var chrono = require('chrono-node')
var request = require('request-promise-native')
var SlackTemplate = botBuilder.slackTemplate
mkdir awesome-sauce && cd $_
export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...
yarn init
yarn add claudia claudia-bot-builder chrono-node request-promise-native
touch bot.js
yarn run claudia create -- --region us-east-1 --api-module bot
yarn run claudia update -- --configure-slack-slash-command
@leemeichin
leemeichin / app.js
Created March 21, 2017 17:50
tf-liedetector boilerplate
var ApiBuilder = require('claudia-api-builder')
var pg = require('pg')
var api = new ApiBuilder()
/**
* configuration settings come from environment:
* PGUSER
* PGDATABASE
* PGPASSWORD
@leemeichin
leemeichin / package.json
Last active March 23, 2017 16:53
tf-liedetector
{
"scripts": {
"create": "claudia create --profile claudia --api-module app --region us-east-1",
"update": "claudia update --profile claudia",
}
}
mkdir tf-liedetector && cd $_
git init
echo "node_modules/" >> .gitignore
yarn init
yarn add claudia claudia-api-builder request-promise-native request pg lodash.find
touch app.js
{
"lambda": {
"role": "my-app-executor",
"name": "my-app",
"region": "us-east-1"
},
"api": {
"id": "abcdefg",
"module": "app",
"url": "https://abcdefg.execute-api.us-east-1.amazonaws.com/latest"