Skip to content

Instantly share code, notes, and snippets.

View dfreniche's full-sized avatar

Diego Freniche dfreniche

View GitHub Profile
@dfreniche
dfreniche / get_provisioning_profile_name
Created September 11, 2014 10:29
bash alias to print human-readable names from iOS provisioning profiles
# print human-readable names from iOS provisioning profiles
get_provisioning_profile_name() {
strings $1 | grep -A 1 "<key>Name</key>" | sed 's/<key>//' | sed 's/<string>//'
}
alias namepp=get_provisioning_profile_name
get_all_provisioning_profile_names() {
@dfreniche
dfreniche / ideista-canvas
Last active August 29, 2015 14:06
ideista canvas: a way to spot a person who has an Idea and want you to work for free on it
__As a__ ideista
__I use a hotmail account__
__I introduce myself__ as a loser
__And I want you__ to _work for free in my shitty project_
__to develop__ _my Idea I'm not going to tell you so you can't copy because it's the new Facebook (yeah, for sure...)
import Foundation
// Not Optional Operator
// Useful to print out Optional values without the "Optional" text
prefix operator !? {}
prefix func !? (any: Any?) -> Any {
if let something = any {
return something
@dfreniche
dfreniche / update-date.sh
Last active December 20, 2015 07:09
A small bash script to find all files with wrong date (1 Jan 1970) and set to current date. Tested in Mac (OS X 10.8) but should work in other UNIXes
#!/bin/bash
#update-date.sh: a small script to find all files with wrong date (1 Jan 1970) and set to current date
COMP_FILE=$HOME/comp_file_delete_me
touch -t 197001020101 $COMP_FILE
echo Comparing with $COMP_FILE
echo Obtaining list of files with wrong date. Will take some time…
find ./ -depth -type f -not -newer $COMP_FILE -print -exec touch {} \;
@dfreniche
dfreniche / gist:6753889
Created September 29, 2013 16:14
My OS X alias
alias ls="ls -alFGh"
@dfreniche
dfreniche / select-xcode.sh
Last active October 11, 2017 19:41
Rather crude script to change between Xcode 8 and Xcode 9 selecting the correct command line tools
#!/bin/bash
# if 1st param empty...
if [ -z "$1" ]
then
echo "Usage: select-xcode {8|9}"
exit
fi
XCODE8_APP=/Applications/Xcode-8.app
#!/bin/bash
# copied from http://blog.pragbits.com/it/2015/02/09/slack-notifications-via-curl/
# format message as a code block ```${msg}```
# SLACK_MESSAGE="\`\`\`$1\`\`\`"
SLACK_MESSAGE="$1"
SLACK_URL=https://hooks.slack.com/services/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
case "$2" in
@dfreniche
dfreniche / .zshrc
Created October 31, 2017 15:24
My ZSH config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/dfreniche/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
@dfreniche
dfreniche / gist:bd6aee071788b2ca94fa9892fba5f579
Created November 2, 2017 10:09
Build Phase Script for adding version information to app icon
#!/bin/sh
if [ $CONFIGURATION = "Release" ]; then
echo "NOT DOING ICON CHANGE"
exit 0
fi
echo $CONFIGURATION
echo "*** STARTED ICON CHANGE ***"
#!/bin/bash
SU_DATE="## `date "+%d %m %Y (%a)"`"
SU_TEXT1="Yesterday:"
SU_TEXT2="Today:"
SU_TEXT3="---"
# weather info
SU_WEATHER=`curl 'wttr.in/Sevilla?format=3'`