Skip to content

Instantly share code, notes, and snippets.

View carlosmcevilly's full-sized avatar

Carlos McEvilly carlosmcevilly

View GitHub Profile
@carlosmcevilly
carlosmcevilly / hack.sh
Created March 31, 2012 17:17 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with useful tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
# tags: scripting testing www script browser ruby automation webdev safari
# tags: watir
# update gem
sudo gem update --system
# check gem version
gem -v
# install safariwatir
@carlosmcevilly
carlosmcevilly / gist:2221332
Created March 27, 2012 23:10
xcode-select command now that dev tools are no longer in /Developer
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
@carlosmcevilly
carlosmcevilly / gist:2221249
Last active April 3, 2025 12:47
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
if (typeof (AC) === "undefined") {
AC = {}
}
AC.ImageReplacer = Class.create({
_defaultOptions: {
listenToSwapView: true,
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i,
filenameInsert: "_☃x",
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i,
attribute: "data-hires",
@carlosmcevilly
carlosmcevilly / gist:1881721
Last active September 28, 2021 05:22
split a .mov file without loss of quality
#!/usr/bin/perl
# command from:
# http://www.linuxquestions.org/questions/linux-newbie-8/how-do-you-split-mpg-files-using-a-ffmpeg-command-542607/
# -vcodec copy copies the raw data
# -ss start seconds?
# -to ?
my $infile = shift;
@carlosmcevilly
carlosmcevilly / uicolor-to-image.pl
Created December 21, 2011 21:26
UIColor to image, using Perl and ImageMagick. This is just scary ugly. Next time I'll do it with Cocoa.
#!/usr/bin/perl
use strict;
use warnings;
my $token;
my @tokens;
my ($num, $denom, $value, $hexcolor);
my $outfile = "result.png";
@carlosmcevilly
carlosmcevilly / gist:1473566
Created December 13, 2011 19:42
Get underlying data from a CGImage
CGDataRef imageDataRef = CGDataProviderCopyData(CGImageGetDataProvider(myCGImageRef)));
@carlosmcevilly
carlosmcevilly / gist:1457794
Created December 11, 2011 02:27
xcodebuild short example
xcodebuild -project Foo.xcodeproj -target Foo -configuration Debug -sdk iphonesimulator5.0 clean build
@carlosmcevilly
carlosmcevilly / make-defaults.sh
Created November 18, 2011 20:02
Make labeled default placeholder images for iPad in various orientations
#!/bin/bash
# <basename><orientation_modifier><scale_modifier><device_modifier>.png
export bgcolor=blue
export txtcolor=#FFFFFF
export fontsm=24
export fontlg=48
# PortraitUpsideDown