Skip to content

Instantly share code, notes, and snippets.

View mglukhovsky's full-sized avatar

Michael Glukhovsky mglukhovsky

View GitHub Profile
@RubenKelevra
RubenKelevra / RethinkDB-story01.txt
Last active August 27, 2015 07:14
Blog: RethinkDB for system-statistics of freifunk-nodes
This story is about: How do we fetch, process and display nice statistics for
freifunk-nodes, running a free, open WiFi-Network.
Else we want to implement pushes for the owner of each freifunk-node, when
something goes wrong or offline.
Status Quo:
Currently we use some hacky bash scripts[1] which generates a text-file, curl it
to a php running server over https and dropping the latest values to a
@UtahDave
UtahDave / rethinkdb.sls
Last active August 29, 2015 14:04
Salt State for RethinkDB on Ubuntu
setup_repo:
pkgrepo.managed:
- humanname: RethinkDB Repo
- name: deb http://download.rethinkdb.com/apt {{ grains['oscodename'] }} main
- file: /etc/apt/sources.list.d/rethinkdb.list
- key_url: http://download.rethinkdb.com/apt/pubkey.gpg
- require_in:
- pkg: rethinkdb
rethinkdb:
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@coffeemug
coffeemug / gist:6168031
Last active February 3, 2022 23:16
The fun of implementing date support
After spending the better part of the month implementing date support
in RethinkDB, Mike Lucy sent the team the following e-mail. It would
have been funny, if it didn't cause thousands of programmers so much
pain. Read it, laugh, and weep!
-----
So, it turns out that we're only going to support dates between the
year 1400 and the year 10000 (inclusive), because that's what boost
supports.
anonymous
anonymous / gist:5853616
Created June 24, 2013 21:06
import rethinkdb as r
import sys
import threading
import time
from datetime import datetime
from random import randint
from faker import Faker
@squarism
squarism / rethinkdb_elastic_spike.rb
Created May 13, 2013 03:54
RethinkDB json store, using nobrainer ORM, automatically update elasticsearch index on save callback. This is fantastic.
require 'tire'
require 'nobrainer'
NoBrainer.connect 'rethinkdb://server/company'
class Employee
include NoBrainer::Document
field :name
field :title
@btmills
btmills / insert_pool.js
Last active July 22, 2019 00:52
Use a connection pool to rapidly insert a large number of records into a RethinkDB database.
var r = require('rethinkdb');
// How many connections in the pool?
// 2547 will fail with "(libuv) Failed to create kqueue (24)"
var CONNECTIONS = 2546;
// Insert this many rows
var COUNT = 10000;
// Database to use for the test
var DB = 'test'
// Table to use for the test
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@lunaru
lunaru / css3-arrow-dropshadow.html
Created April 25, 2012 23:18
CSS Box with Arrow and Dropshadow
<!DOCTYPE html>
<html>
<head>
<style>
/* Core CSS */
#box
{
background: white;