Skip to content

Instantly share code, notes, and snippets.

View goopi's full-sized avatar

Gustavo Leguizamon goopi

  • Buenos Aires, Argentina
View GitHub Profile
@goopi
goopi / capitan-beta-6-fix.sh
Created August 5, 2015 22:37
El Capitan beta 6 + Xcode fix
# Xcode 7 beta
cd /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
sudo mv dyld_sim dyld_sim.orig
cd /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/usr/lib
sudo mv dyld_sim dyld_sim.orig
# Xcode 6.4
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib
sudo mv dyld_sim dyld_sim.orig
@goopi
goopi / easing.css
Created March 24, 2017 03:59 — forked from bendc/easing.css
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@goopi
goopi / macos-usb.sh
Last active October 17, 2016 01:13
macOS boot disk
$ # Mavericks
$ sudo ~/Desktop/Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Mavericks --applicationpath ~/Desktop/Mavericks.app --nointeraction
$ # macOS Sierra
$ sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Sierra --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
@goopi
goopi / rAF.js
Last active January 1, 2016 20:59 — forked from paulirish/rAF.js
requestAnimationFrame polyfill #js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@goopi
goopi / screen-vertsplit.patch
Created December 20, 2013 21:27
GNU Screen vertical split patch #screen
diff -rupN old/ansi.c new/ansi.c
--- old/ansi.c 2006-05-02 05:58:25.000000000 -0700
+++ new/ansi.c 2010-12-31 14:10:12.000000000 -0800
@@ -559,7 +559,7 @@ register int len;
{
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- if (curr->w_NumArgs < MAXARGS)
+ if (curr->w_NumArgs >= 0 && curr->w_NumArgs < MAXARGS)
{
@goopi
goopi / python-packages.sh
Created December 19, 2013 20:10
Python "site-packages" location #python
#!/bin/bash
python -c "import site; print(site.getsitepackages())"
@goopi
goopi / not-defensively.md
Created December 18, 2013 06:25
Do not program "defensively"

Do not program "defensively"

A defensive program is one where the programmer does not "trust" the input data to the part of the system they are programming. In general one should not test input data to functions for correctness. Most of the code in the system should be written with the assumption that the input data to the function in question is correct. Only a small part of the code should actually perform any checking of the data. This is usually done when data "enters" the system for the first time, once data has been checked as it enters the system it should thereafter be assumed correct.

Example:

%% Args: Option is all|normal
get_server_usage_info(Option, AsciiPid) ->
 Pid = list_to_pid(AsciiPid),
afconvert -d LEI16 -f 'caff' input.wav output.caf
@goopi
goopi / nsarray-slice.m
Last active December 29, 2015 18:09 — forked from mikeash/test.m
// clang -framework Foundation -fobjc-arc -O3 test.m
#import <Foundation/Foundation.h>
@interface Slice : NSObject
@property NSInteger start;
@property NSInteger length;
@end
@implementation Slice
@goopi
goopi / png2favicon.md
Created September 13, 2013 17:02
favicon.ico from png files

$ png2ico favicon.ico favicon-16.png favicon-32.png favicon-64.png