Skip to content

Instantly share code, notes, and snippets.

View unix-junkie's full-sized avatar

Andrey S. unix-junkie

  • Weyland-Yutani Corp.
  • Proxima Centauri
View GitHub Profile
@pvdb
pvdb / list_targets.sh
Last active November 8, 2023 08:18
List all targets (sometimes incorrectly referred to as "goals") in a GNU Makefile
#
# this gist can be used to list all targets, or - more correctly - rules,
# that are defined in a Makefile (and possibly other included Makefiles)
# and is inspired by Jack Kelly's reply to a StackOverflow question:
#
# http://stackoverflow.com/questions/3063507/list-goals-targets-in-gnu-make/3632592#3632592
#
# I also found this script - http://www.shelldorado.com/scripts/cmds/targets - which does
# something similar using awk, but it extracts targets from the "static" rules from a single
# Makefile, meaning it ignores any included Makefiles, as well as targets from "dynamic" rules
@RobertDober
RobertDober / guitablabel.vim
Created March 31, 2011 13:38
How to set the tablabel in vim
"
" Guitablabels
"
let t:tablabel="<>"
function! GuiTabLabel()
if exists("t:tablabel")
return t:tablabel
else
return expand("%f")
" or do something more clever
@uarun
uarun / filetype.vim
Created August 3, 2011 19:32
Gradle syntax highlighting in vim
# ~/.vim/filetype.vim
au BufNewFile,BufRead *.gradle setf groovy
@utsengar
utsengar / Sleepsort.java
Created November 9, 2011 21:59
Java version of Sleep sort
/**
* For fun.
* Inspiration: http://dis.4chan.org/read/prog/1295544154
* @author zengr
*
*/
public class Sleepsort {
private static int[] inputArray = { 3, 1, 2, 1, 181, 10};
@koduki
koduki / fontconfig.properties
Created January 7, 2012 18:47 — forked from msnoigrs/fontconfig.properties
fontconfig.properties for jre on arch linux
#
# For Arch Linux
#
# Version
version=1
# Component Font Mappings
@wfaler
wfaler / init.el
Created April 26, 2012 12:12
init.el
(add-to-list 'load-path "~/.emacs.d/scala-mode")
(add-to-list 'load-path "~/.emacs.d/ensime/elisp")
(require 'scala-mode-auto)
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
@yenliangl
yenliangl / fontconfig.properties
Created July 23, 2012 04:24
Java's fontconfig.properties file for Windows 7
# %W% %E%
#
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# Version
version=1
# Component Font Mappings
@bradfitz
bradfitz / diskchecker.pl
Created July 24, 2012 21:05
diskchecker.pl
#!/usr/bin/perl
#
# Brad's el-ghetto do-our-storage-stacks-lie?-script
#
sub usage {
die <<'END';
Usage: diskchecker.pl -s <server[:port]> verify <file>
diskchecker.pl -s <server[:port]> create <file> <size_in_MB>
diskchecker.pl -l [port]
@aruld
aruld / YFact.java
Created October 27, 2012 20:12 — forked from jonbodner/YFact.java
Generic Y Combinator in Java 8 using lambdas
//based on code from http://www.arcfn.com/2009/03/y-combinator-in-arc-and-java.html and the generic version https://gist.github.com/2571928
class YFact {
// T function returning a T
// T -> T
public static interface Func<T> {
T apply(T n);
}
// Higher-order function returning a T function
@mattratleph
mattratleph / vimdiff.md
Last active June 21, 2024 15:33 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)