Skip to content

Instantly share code, notes, and snippets.

@ryanchang
ryanchang / lldb_cheat_sheet.md
Last active June 21, 2026 10:43
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active March 12, 2025 19:23
Diagrams for Documentation

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@staltz
staltz / introrx.md
Last active September 11, 2026 21:25
The introduction to Reactive Programming you've been missing
@js1972
js1972 / infinite_streams.scala
Created June 17, 2014 01:09
Infinite Streams in Scala. Using infinite streams to efficiently calculate primes and square roots in a Scala Worksheet.
package week7
object primes {
//infinite stream builder
def from(n: Int): Stream[Int] = n #:: from(n + 1)
//> from: (n: Int)Stream[Int]
//infinte stream of all natural numbers
val nats = from(0) //> nats : Stream[Int] = Stream(0, ?)
val m4s = nats map (_ * 4) //> m4s : scala.collection.immutable.Stream[Int] = Stream(0, ?)
@acoomans
acoomans / chspecs.sh
Created May 1, 2014 15:21
Change Xcode build specs by merging OSX's specs in iPhone Simulator's specs
#!/bin/bash
# Change Xcode build specs by merging OSX's specs in iPhone Simulator's specs
# This allows to build dynamic libraries for the simulator
PLISTBUDDY="/usr/libexec/PlistBuddy"
ROOT=`xcode-select -print-path`
SIM_SPECS_DIR="$ROOT/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications"
OSX_SPECS_DIR="$ROOT/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications"
@blouerat
blouerat / Foobar.java
Last active September 29, 2016 00:50
Why Java 8 matters
package java8fun;
public class Foobar {
private String foo;
private Integer bar;
public Foobar(String foo, Integer bar) {
this.foo = foo;
this.bar = bar;
@thomasfr
thomasfr / iptables.sh
Last active November 17, 2025 22:18
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@pascalpoitras
pascalpoitras / 1.md
Last active August 30, 2026 15:30
My WeeChat configuration

This configuration is no longer updated

@wishfoundry
wishfoundry / gist:7036457
Last active April 1, 2022 05:18
Set OSX default text editor to sublime text 3 instead of TextEdit
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}'
@stormwild
stormwild / virtualbox-clone-fixed-to-dynamic.md
Last active March 26, 2024 04:06
VirtualBox clone fixed size vm to dynamic, resize dynamic vm, expand partition

http://brainwreckedtech.wordpress.com/2012/01/08/howto-convert-vdis-between-fixed-sized-and-dynamic-in-virtualbox/ http://www.webdesignblog.asia/software/linux-software/resize-virtualbox-disk-image-manipulate-vdi/#comment-474

While there is no way to actually switch a VDI between fixed-size and dynamic, you can clone the existing VDI into a new one with different settings with VBoxManage.

VBoxManage clonehd [old-VDI] [new-VDI] --variant Standard
VBoxManage clonehd [old-VDI] [new-VDI] --variant Fixed

If you want to expand the capacity of a VDI, you can do so with