Skip to content

Instantly share code, notes, and snippets.

@aktau
aktau / gist:1959603
Created March 2, 2012 16:50
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@aktau
aktau / Clock.java
Created June 6, 2012 08:12 — forked from jewelsea/Clock.java
Sample of an animated clock in JavaFX
import javafx.animation.*;
import javafx.application.Application;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.effect.Glow;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;

The best way to use this tool is to hook apt's use of dpkg to run it before doing any package installs.

In your apt.conf, put this:

DPkg::Pre-Install-Pkgs {"xargs -rL1 bash /path/to/stripdeb.sh 2>&1 | logger -t stripdeb"}

Then, a demo:

% sudo apt-get install mysql-server-5.1

@aktau
aktau / gist:5330470
Last active December 15, 2015 22:09 — forked from Kerrick/gist:2716568
#!/bin/bash
# set -e
set -u
AKBREW_CELLAR="/usr/local/aktau"
CURRENT_USER=$(whoami)
# create AKBREW_CELLAR if it does not exist
@aktau
aktau / inthash.md
Created August 19, 2013 12:30 — forked from badboy/inthash.md
local ffi = require("ffi")
ffi.cdef[[
typedef void (*cb)(void);
void call(int n, void (*)(void));
void loop(int n);
void func(void);
]]
local callback = ffi.load("./callback.so")
local timeit = require("timeit")
#
# Place this code to your .profile, .bashrc, .bash_profile or whatever
#
program_exists () {
type "$1" &> /dev/null ;
}
if program_exists go; then
##
## Simple password management in ksh-compatible shell
## You'll need a unix-like system and a working GPG configuration
export GPG_KEY=""
function pwgrep() {
gpg --batch -q -d -r $GPG_KEY $HOME/.auth/pwdb.asc | grep $*
}
function pwcat() {
@aktau
aktau / lisp.c
Created April 4, 2014 19:25 — forked from sanxiyn/lisp.c
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,