Skip to content

Instantly share code, notes, and snippets.

View damiancarrillo's full-sized avatar

Damian Carrillo damiancarrillo

View GitHub Profile
@damiancarrillo
damiancarrillo / symlink-mobiledevicesupport.bash
Last active April 16, 2021 05:50
Using an older version of Xcode after updating your phone
#!/bin/bash
for i in *.HEIC
do
#echo $i
#ffmpeg -i "$i" -frames:v 1 -vsync vfr -q:v 1 -an "${i%HEIC}jpg"
sips --setProperty format jpeg "$i" --out "${i%HEIC}jpg"
done
### Keybase proof
I hereby claim:
* I am damiancarrillo on github.
* I am damiancarrillo (https://keybase.io/damiancarrillo) on keybase.
* I have a public key ASCw9PJB648jvofkgm68SJelkyulpuRJ2D5hVq84Zdz_pAo
To claim this, I am signing this object:
@damiancarrillo
damiancarrillo / app.swift
Created November 18, 2018 23:28 — forked from lucamarrocco/app.swift
swift osx application without nib
import Cocoa
class WindowController: NSWindowController {
}
class AppDelegate: NSObject {
var mainWindow: NSWindow?
var mainController: NSWindowController?
}
@damiancarrillo
damiancarrillo / rbt.swift
Created November 23, 2015 04:16 — forked from airspeedswift/rbt.swift
Red Black Tree with indirect and pattern matching for Swift 2.0b4
enum Color { case R, B }
indirect enum Tree<Element: Comparable> {
case Empty
case Node(Color,Tree<Element>,Element,Tree<Element>)
init() { self = .Empty }
init(_ x: Element, color: Color = .B,
left: Tree<Element> = .Empty, right: Tree<Element> = .Empty)
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
@damiancarrillo
damiancarrillo / sqlite-snoop.d
Created April 15, 2012 22:37
A SQLite DTrace Logger
#!/usr/sbin/dtrace -Zs/*
sqlite-snoop.d
Author: Damian Carrillo
Usage: sudo ./libsqlite_snoop.d <pid>
Date: 2012-04-03
*/
@damiancarrillo
damiancarrillo / debug.sh
Created November 12, 2011 15:37
Appengine debug script
#!/bin/bash
#
# Launches the development AppServer
#
# Usage:
# ./debug.sh --port=8888 ~/Development/Project/target/Project-SNAPSHOT
[ -z "${DEBUG}" ] || set -x # trace if $DEBUG env. var. is non-zero
SDK_BIN=`dirname $0 | sed -e "s#^\\([^/]\\)#${PWD}/\\1#"` # sed makes absolute
SDK_LIB=$SDK_BIN/../lib
@damiancarrillo
damiancarrillo / counter.sh
Created November 9, 2011 22:38
Bash timer
#! /usr/bin/env bash
for i in $(seq 1 5); do if [ $i = "1" ]; then echo -n $i; sleep 1; else echo -n "^H$i"; sleep 1; fi; done
@damiancarrillo
damiancarrillo / objc-formatter.sh
Created October 20, 2011 21:26
An Objective-C code formatter
#! /usr/bin/env awk -f
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright © 2011, Damian Carrillo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.