Skip to content

Instantly share code, notes, and snippets.

View Palleas's full-sized avatar

Romain Pouclet Palleas

View GitHub Profile
@chrismiles
chrismiles / reveal.py
Last active September 2, 2021 00:26
Lazy script to wrap Reveal lib load/start commands in one LLDB command.
""" File: reveal.py
Add to ~/.lldbinit:
command script import ~/.lldb-scripts/reveal.py
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode?
A: In Xcode:
Add a Symbolic Breakpoint
Symbol: "UIApplicationMain"
Action: Debugger Command with value "reveal"
@mattt
mattt / UIImageForSwatchOfColorWithSize.h
Created September 27, 2013 01:25
Create a UIImage swatch of a color with a specified size.
static UIImage * UIImageForSwatchOfColorWithSize(UIColor *color, CGSize size) {
UIImage *image = nil;
CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
{
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(c, [color CGColor]);
@m4dz
m4dz / gist:4065644
Created November 13, 2012 12:59
LessCSS transition compliant syntax
// CSS TRANSITIONS ------------------------------------------------------------/
// I pass 2 args to the method but the second one is only here to prevent
// LessCSS to this bloody trick that @arguments return an array if there's two
// args but a string when there's only one oO'…
.transition (@param, @fakeParam:X, ...)
{
// Explode arguments and remove the fakeParam
@args : ~`"@{arguments}".replace(/[\[\]]|\sX/g, '')`;
// Specify prefixable properties seperated with commas
// i.e.: ~"transform,opacity"