Skip to content

Instantly share code, notes, and snippets.

View Gargron's full-sized avatar

Eugen Rochko Gargron

View GitHub Profile
@Gargron
Gargron / docker-run
Created January 14, 2015 12:14
Git hook (post-update) for gitolite
#!/bin/bash
echo "Going to handle Docker image now..."
HOME="/home/dkr"
REPO=$GL_REPO
BARE_PATH="$HOME/repositories/$REPO.git"
WORK_PATH="$HOME/$REPO"
USER=$GL_USER
var Node = function (config, _isTerminal) {
this.config = config;
this._isTerminal = _isTerminal;
};
Node.prototype.isTerminal = function () {
this.evaluate();
return this._isTerminal;
};
@Gargron
Gargron / INSTALL.md
Last active September 15, 2023 17:49 — forked from namuol/INSTALL.md
"Fuck you" alias to kill processes

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@Gargron
Gargron / README.md
Last active December 30, 2015 23:29
Configure a list of YouTube channels, and you can run this regularly to download new videos.

Configure a list of YouTube channels, and you can run this regularly to download new videos.

Creates .check-youtube folder in the user's home directory, where configuration and videos are stored. Example config.yml:

channels:
  - bluexephos
  - YogscastSips

Uses Ruby and the YouTube DL command-line utility.

@Gargron
Gargron / home-backup.sh
Created October 14, 2013 15:16
Script to do an incremental backup of the home directory of a user
#! /bin/sh
DRIVE_PATH="/path/to/drive"
USER="joe"
BACKUP_PATH="$DRIVE_PATH/backups/$USER@$(hostname)"
if command -v rdiff-backup >/dev/null 2>&1; then
echo "Checking drive..."
if ! [ -d "$DRIVE_PATH" ]; then
import java.util.ArrayList;
import java.util.Collections;
/**
* Knoten
*
* @author Eugen Rochko
*/
class Node {
@Gargron
Gargron / gist:3579337
Created September 1, 2012 16:24
Metrics with Mongo
<?php
/**
* Example usage:
*
* Metric::record(1, 'slot', 12, 'impression');
*
*/
class Metric
@Gargron
Gargron / apiauth.php
Created April 23, 2012 16:14
API call authorization class for The Colorless API
<?php
/**
* Used to authorize API calls based on public API keys
* and private encryption comparison. Only useful for
* server-side API calls since you'd have to open
* up the private key in plaintext if you tried to do
* this from JavaScript.
*
* @author Eugen Rochko
@Gargron
Gargron / sorter.php
Created March 27, 2012 21:41
PHP Sorter abstraction
<?php namespace Sorter;
class Sorter
{
/**
* Apply sorting logic to a given DB query. Look-up the model's rules to allow/disallow and alias sorting types
*
* @param $sort_by string Sorting subject
* @param $direction integer 1 or -1
* @param $query string