Skip to content

Instantly share code, notes, and snippets.

View boris-chervenkov's full-sized avatar

Boris Chervenkov boris-chervenkov

View GitHub Profile
#!/usr/bin/env python
from sys import argv
if len(argv) != 2:
print('usage: %s filename.kv' % argv[0])
exit(1)
from kivy.lang import Builder
from kivy.app import App
@jewelia
jewelia / gist:0b8f26e91f2818bef460
Last active August 29, 2015 14:15
3 Great Engineering Management Talks from 2014

General key themes:

  • Hiring is really hard. You’re not just hiring a “Rails Engineer” or a “Python Programmer” you’re hiring someone who can help you change the world. Tell them why! Talk about the hard problems you’re solving. 2/3 of these talks give ideas and insight into hiring from sourcing to actual interview processes.

  • Rewriting systems is hard. People think they are going to replace their broken down horse and buggie with a bullet train and this often ends up in disaster. Successful rewrites require an incremental approach that takes months/years and often runs way over schedule. 2/3 of these talks go over how to handle rewrites not only from a high level technical perspective but a cultural/management perspective as well.

Two Developers, Many Lines of Code, and A Campaign that Made History

Harper Reed (CTO of Obama for America, now CEO of Modest) and Dylan Richard (Director of Eng of Obama for America, now CTO of Modest)

@import url(http://fonts.googleapis.com/css?family=Open+Sans);
*, *::before, *::after {
box-sizing: border-box;
}
body {
background: #FDFDFD;
margin: 25px 0;
}
@vitaLee
vitaLee / Default (OSX).sublime-keymap
Created August 26, 2012 12:13
Sublime Text - Extended Add Line command, allowing column selection even on shorter lines.
[
{ "keys": ["ctrl+alt+up"], "command": "smart_select_lines", "args": {"forward": false} },
{ "keys": ["ctrl+alt+down"], "command": "smart_select_lines", "args": {"forward": true} }
]
@dylanvalade
dylanvalade / bootstrap-3-xs-offset-shim.css
Created November 7, 2013 22:11
Add col-xs-offset-* shim to Bootstrap 3 for the mobile (xs) display responsive column offsetting that does not exist in the standard Bootstrap CSS.
/*
Include this after bootstrap.css
Add a class of 'col-xs-offset-*' and
if you want to disable the offset at a larger size add in 'col-*-offset-0'
Examples:
All display sizes (xs,sm,md,lg) have an offset of 1
<div class="col-xs-11 col-xs-offset-1 col-sm-3">
@bsnux
bsnux / sublime_text2.md
Last active January 4, 2016 21:28
Sublime Text 2 shortcuts

Sublime Text 2 Mac OS X Keyboard shortcuts

Keys

  • ⇧: Shift
  • ⌘: Command
  • ⌃: Control
  • ⌥: Alt/Option
  • →: Right cursor
@arvidfm
arvidfm / asyncio-tornado.py
Last active December 4, 2018 12:56
Running Tornado on asyncio's event loop, including 'yield from' support in request handlers
import asyncio
import tornado.concurrent
import tornado.ioloop
import tornado.web
import tornado.platform.asyncio
import tornado.httpclient
class ReqHandler(tornado.web.RequestHandler):
async def get(self):
@progrium
progrium / gist:5734609
Last active October 14, 2019 07:15
Let unprivileged processes easily restart/reload Nginx without sudo or setuid hacks
# run this as root
while [ 1 ]; do echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload; done
# or as an upstart job
script
echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload
end script
respawn
# now any process can run this or do the equivalent with sockets to trigger reload
@real34
real34 / monitor_slave.js
Created June 6, 2013 10:05
CasperJs script to monitor MySQL replication slave status through PhpMyAdmin. Tested with PhpMyAdmin v3.3.9
var casper = require('casper').create();
var utils = require('utils');
var phpMyAdminUrl = casper.cli.args[0];
var phpMyAdminCredentials = {
pma_username: casper.cli.options.user,
pma_password: casper.cli.options.password
};
if (!phpMyAdminUrl || !phpMyAdminCredentials.pma_username || !phpMyAdminCredentials.pma_password) {
casper.echo('Invalid parameters. Usage: casperjs monitor_slave.js http://example.com/phpMyAdmin --user=foo --password=bar');
@coldnebo
coldnebo / Default (Linux).sublime-keymap
Created August 10, 2011 23:20
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]