Skip to content

Instantly share code, notes, and snippets.

View carlosmcevilly's full-sized avatar

Carlos McEvilly carlosmcevilly

View GitHub Profile
@carlosmcevilly
carlosmcevilly / multiple_ssh_setting.md
Created October 18, 2012 13:20 — forked from fanwaze-dev/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github accounts

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@carlosmcevilly
carlosmcevilly / gist:2221249
Created March 27, 2012 22:55
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"
@carlosmcevilly
carlosmcevilly / async_scraper.py
Created July 10, 2017 20:50 — forked from wtneal/async_scraper.py
asyncio scraper
import asyncio
import aiofiles
import aiohttp
import logging
import re
import sys
import os
import lxml.html
@carlosmcevilly
carlosmcevilly / git-co-function.sh
Last active November 14, 2022 05:42
convenience bash function to git checkout whatever branch matches the passed-in substring
# git-co
# git checkout whatever branch matches the passed-in substring
#
# Argument:
# substring to match
#
# Example:
# git-co sparkles # checks out the branch whose name contains the substring "sparkles"
#
# Will abort with an informative message and no action in various error scenarios.
@carlosmcevilly
carlosmcevilly / elshirt.pl
Created March 5, 2016 04:42
El Shirt snake oil crypto submission
#!/usr/bin/perl -T # use -T because it makes things secure
use strict;
use warnings;
# El Shirt key preparation algorithm
#
# El Shirt is an anagram of SLITHER
#
# **** Background ****
@carlosmcevilly
carlosmcevilly / random-color-function.sh
Last active December 12, 2021 18:20
generate a single random hex color string
function randomColor () {
# assuming 24-bit color
range_max=$((256 * 256 * 256))
printf "%06x\n" $(((((RANDOM*RANDOM)+(RANDOM*RANDOM))+RANDOM)%range_max))
}
# test
# $ for in in {0..99999}; do randomColor; done | sort | uniq | wc -l
# (should output a number roughly near 99700)
@carlosmcevilly
carlosmcevilly / apple-development-reference-links.md
Last active December 8, 2021 20:02
Device and software version reference links for development in Apple ecosystem
@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 / symbolicate-crash.sh
Created September 20, 2012 21:42
symbolicate a crash for an iOS app
#!/bin/bash
export log=$1
export dsym=$2
export app=$3
if [[ "$app" == '' ]]; then
echo usage: $0 '<logfile> <dSYM folder> <.app folder>'
echo
exit -1
@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