Skip to content

Instantly share code, notes, and snippets.

View kunev's full-sized avatar
🐻
I break things to see how they (don't) work | I pass the butter

Evgeni Ku kunev

🐻
I break things to see how they (don't) work | I pass the butter
View GitHub Profile
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active April 19, 2024 04:06
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@fmakowski
fmakowski / README.md
Created November 24, 2017 10:59 — forked from BrianHicks/README.md
Graph taskwarrior tasks with graphviz

Graph taskwarrior tasks with graphviz

Dependencies

Running

graphdeps produces "deps.png" in the working directory. Just graphdeps will graph all tasks. You can change the default behavior by specifying a more specific query.

@bpierre
bpierre / README.md
Last active February 15, 2024 18:40
Switch To Vim For Good

Switch To Vim For Good

NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.

My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0

@markrendle
markrendle / MITEA.license
Created March 30, 2015 10:53
The "MIT Except Apple" License
The MIT-except-Apple License (MIT-EA)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person (except
anybody associated with Apple Inc.) obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@simon-weber
simon-weber / rchandler.py
Last active July 31, 2018 13:58
An example of using a StackContext to store request data globally in Tornado. See https://groups.google.com/d/msg/python-tornado/8izNLhYjyHw/TNKGa9fgvpUJ for motivation and further discussion.
import tornado
class RequestContextHandler(tornado.web.RequestHandler):
def _execute(self, transforms, *args, **kwargs):
# following the example of:
# https://github.com/bdarnell/tornado_tracing/blob/master/tornado_tracing/recording.py
global_data = {} # add whatever here, e.g. self.request
#! /bin/sh
# Refactored from Ubuntu's hdparm script
# It isn't safe to set an APM policy by default on Firewire or USB devices.
# See https://bugs.launchpad.net/bugs/515023.
has_apm()
{
hdparm -i $dev 2> /dev/null | grep -q 'AdvancedPM=yes'
}
@peternixey
peternixey / securing_rails_updates.md
Created March 5, 2012 13:10
How Homakov hacked GitHub and how to protect your application by Peter Nixey

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.

If you'd like to follow me on twitter my handle is @peternixey


@vladimiroff
vladimiroff / vimium.vim
Created November 4, 2011 12:41
Mappings for Vimium
" Unmap these silly J,K
unmap J
unmap K
map <C-h> previousTab
map <C-l> nextTab
" Cyrillic shortcuts
map гг scrollToTop
map Г scrollToBottom