Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
rosswd /
Last active May 12, 2018
The stack, heap, registers and instructions

Stack, Heap, Registers and Instructions

  1. Stack (push, pop, stack pointer, stack frame pointer)
  2. Heap (malloc, calloc, global, static)
  3. Registers (addresses, values)
  4. Instructions (mov, add, jmp, jne)

The Stack (LIFO)

  • push adds an element to the top of the stack
  • pop removes the top element from the stack
fsteffenhagen /
Created Mar 3, 2017
sum human readable file sizes with numfmt and awk
# Input: list of rows with format: "<filesize> filename", e.g.
# filesizes.txt
# 1000K file1.txt
# 200M file2.txt
# 2G file3.txt
# Output:
cat filesizes.txt | numfmt --from=iec | awk 'BEGIN {sum=0} {sum=sum+$1} END {printf "%.0f\n", sum}'
View feedly-colorful-list-view.user.js
// ==UserScript==
// @name Feedly Colorful Listview
// @namespace http://feedly.colorful.list.view
// @description Colorizes items headers based on their source
// @include http*://*
// @include http*://**
// @version 0.11.2
// ==/UserScript==
const colors = {};
View jooq-mockito-deep-stub-example
DSLContext database = Mockito.mock(DSLContext.class, Mockito.RETURNS_DEEP_STUBS);
inooid / .bash_profile
Created Mar 16, 2015
Google command to search on Google from the command line (Mac OS X)
View .bash_profile
# Command to open the webbrowser and immediately start searching
# for the right keyword.
# Usage:
# $ google test query
# $ => Opens the browser on
rmorenobello / setSystemPropertyFromCLI.groovy
Last active Nov 2, 2020
How to set and retrieve JVM system variables when running java/groovy from CLI
View setSystemPropertyFromCLI.groovy
System properties are set on the java command line using the
java -Dpropertyname=value
They can also be added at runtime using
System.setProperty(name, value)
or via the various
pascalalich / eclipse-templates.xml
Created Feb 18, 2015
Eclipse Templates for Java logging, hashCode, equals, and toString with SLF4J and Guava
View eclipse-templates.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="java" deleted="false" description="equals (Guava)" enabled="true" name="equals">${:import(}&#13;
public boolean equals(final Object obj) {&#13;
if (this == obj) {&#13;
return true;&#13;
if (obj == null) {&#13;
return false;&#13;
if (getClass() != obj.getClass()) {&#13;
andrewh / anyconnect.scpt
Last active Mar 22, 2021
Applescript to automate the Cisco AnyConnect SSL VPN client on OS X Mavericks
View anyconnect.scpt
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor
-- 2. Substitute "" and "redacted" for your VPN server and password
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 4. Enable Applescript Editor and System UI Server
-- 5. Trigger script from the menu
-- 6. Enjoy being connected
tell application "Cisco AnyConnect Secure Mobility Client"
end tell
p1nox /
Last active Mar 17, 2021
Using meld on Mac

Using Meld merging tool on Mac

brew tap homebrew/cask
brew cask install meld
  • If meld doesn't start while executing from terminal, try this:

Modify the /usr/local/Caskroom/meld/3.19.2-r6,osx-15/ script installed by brew to the following

View hide others.applescript
tell application "System Events"
--set visible of every process whose visible is true and name is not in {"Finder", name of current application} to false
set visible of every process whose visible is true and name is not "Finder" and frontmost is false to false
end tell