This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
import org.apache.commons.io.IOUtils | |
import org.eclipse.jetty.http.HttpHeaders | |
import org.eclipse.jetty.testing.HttpTester | |
import org.eclipse.jetty.io.ByteArrayBuffer | |
import util.DynamicVariable | |
import org.scalatra.test.ScalatraTests | |
import java.net.HttpCookie | |
import java.io.{ByteArrayOutputStream, FileInputStream, File} | |
trait ScalatraFileUploadTests extends ScalatraTests { |
#include <node.h> | |
#include <v8.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
using namespace v8; | |
Handle<Value> getRandomCoords2D(const Arguments& args) { | |
HandleScope scope; | |
(function() { | |
var fabric, fs, mktemp, d3; | |
d3 = require('d3'); | |
mktemp = require('mktemp'); | |
fabric = require('fabric').fabric; | |
fs = require('fs'); | |
path = require('path'); | |
module.exports = function(robot) { |
# this monit config goes in /etc/monit/conf.d | |
check process puma_master | |
with pidfile /data/myapp/current/tmp/puma.pid | |
start program = "/etc/monit/scripts/puma start" | |
stop program = "/etc/monit/scripts/puma stop" | |
group myapp | |
check process puma_worker_0 | |
with pidfile /data/myapp/current/tmp/puma_worker_0.pid |
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)
EMOJI CHEAT SHEET
Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โ Got flash enabled? Click the emoji code and it will be copied to your clipboard.
People
๐
import numpy as np | |
class InvertedIndex(object): | |
def __init__(self, x): | |
self.J = np.argsort(x) | |
D = np.ediff1d(x[self.J], to_begin=1, to_end=1) | |
self.I = np.repeat(np.arange(len(D)), D) | |
def __getitem__(self, k): |