Skip to content

Instantly share code, notes, and snippets.

View heydamianc's full-sized avatar

Damian Carrillo heydamianc

View GitHub Profile
@heydamianc
heydamianc / format.awk
Created October 5, 2011 22:04
Formats Objective-C code (unfinished)
#! /usr/bin/env awk -f
BEGIN {
shiftWidth = 4
expandedTab = createExpandedTab(4)
}
{
s = stripTrailingWhitespace($0)
s = expandTabs(s, expandedTab)
@heydamianc
heydamianc / 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.
@heydamianc
heydamianc / 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
@heydamianc
heydamianc / 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
@heydamianc
heydamianc / 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
*/
#!/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
@heydamianc
heydamianc / 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)
@heydamianc
heydamianc / 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?
}
### 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:
#!/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