Skip to content

Instantly share code, notes, and snippets.

View orbanbalage's full-sized avatar
🏠
Working from home

Balázs Orbán orbanbalage

🏠
Working from home
View GitHub Profile
@davidreuss
davidreuss / useful bashisms
Created July 10, 2009 11:46
useful bashisms
#!/bin/bash
# Default variable if not set
[ -z "${var:-}" ] && var="Default..."
echo "$var"
# array declaration
/* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon
* http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */
s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17
?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;}
@dolmen
dolmen / export-wifi-profiles.cmd
Created March 10, 2011 17:54
Export all Windows Wifi profiles (SSID, password) in XML
:: Run with full administrator rights
netsh wlan export profile folder=. key=clear
@mbmccormick
mbmccormick / gist:941666
Created April 26, 2011 01:56
Windows 7 login screen customization
HKLM\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background\OEMBackground
@zanshin
zanshin / .zshrc
Created August 12, 2011 19:09
My .zshrc file
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="zanshin"
@mislav
mislav / aprompt.png
Last active February 11, 2024 06:40
My zsh prompt. No oh-my-zsh needed
aprompt.png
@kyanny
kyanny / fib.exs
Created March 13, 2012 01:27
Elixir fibonacci #1
defmodule Fib do
def fib(0) do 0 end
def fib(1) do 1 end
def fib(n) do fib(n-1) + fib(n-2) end
end
IO.puts Fib.fib(10)
@itsdamslife
itsdamslife / Applescript2plist.scpt
Created August 16, 2012 10:55
Saving information in plist through Applescript (In example: current track played in iTunes)
tell application "System Events"
tell application "iTunes"
set mytrack to name of current track
set myalbum to album of current track
set myartist to artist of current track
end tell
-- create an empty property list dictionary item
set the parent_dictionary to make new property list item with properties {kind:record}
@Boldewyn
Boldewyn / cssgrep.sh
Last active March 20, 2023 13:49
cssgrep prints the part of HTML files, that match a given CSS selector. Solution based on this answer on StackOverflow: http://stackoverflow.com/a/14187086/113195
#!/bin/bash
function _usage() {
cat <<USAGE
usage: $(basename $0) PATTERN [FILES]
Print the HTML that matches the CSS selector PATTERN.
USAGE
}
@umbrant
umbrant / hdfs-player.js
Last active September 26, 2017 10:48
Bookmarklet to play audio files right from the Namenode web UI!
javascript:(function(){
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;