Skip to content

Instantly share code, notes, and snippets.

View betzerra's full-sized avatar

Ezequiel Alejandro Becerra betzerra

View GitHub Profile
@betzerra
betzerra / news.sh
Last active December 26, 2015 04:25
Muestra las últimas noticias en medios argentinos
#!/bin/bash
casperjs tn_news.js
./rss_news.rb http://www.clarin.com/rss/lo-ultimo/ Clarin
./rss_news.rb http://contenidos.lanacion.com.ar/herramientas/rss-origen=2 LaNacion
@betzerra
betzerra / README.md
Last active December 19, 2015 04:57 — forked from thom4parisot/README.md
Instagram Hashtag Archiver

Instagram Hashtag Archiver

This script helps you to download locally the latest pictures related to a specific Instagram hashtag. It will fetch them and sort them by username.

No resume feature. No extra metadata. No OAuth pain.

Install

@betzerra
betzerra / gist:4732967
Created February 7, 2013 18:19
CGImageFromFile
CGImageRef CGImageFromFile (NSString* path){
// Get the URL for the pathname passed to the function.
NSURL *url = [NSURL fileURLWithPath:path];
CGImageRef myImage = NULL;
CGImageSourceRef myImageSource;
CFDictionaryRef myOptions = NULL;
CFStringRef myKeys[2];
CFTypeRef myValues[2];
// Set up options if you want them. The options here are for
@betzerra
betzerra / gist:4248239
Created December 10, 2012 03:36
Sepia Image
// Image processing: creating CIImage
NSString *filename = [module.imageFilename stringByDeletingPathExtension];
NSString *fileExtension = [module.imageFilename pathExtension];
NSString *filePath = [[NSBundle mainBundle] pathForResource:filename ofType:fileExtension];
NSURL *fileURL = [NSURL fileURLWithPath:filePath];
CIImage *coreImage = [CIImage imageWithContentsOfURL:fileURL];
CIContext *context = [CIContext contextWithOptions:nil];
// Image processing: applying filter
@betzerra
betzerra / gist:4236646
Created December 7, 2012 21:22
Curl commands
#GET
curl -HAccept:text/plain http://example.com/base
#PUT
curl -XPUT -HContent-type:text/plain --data "stuff:morestuff" http://example.com/base?param=val
#DELETE
curl -XDELETE http://example.com/base/user/123
#POST
@betzerra
betzerra / gist:3830789
Created October 4, 2012 00:31
Get a NSString with current song's title and artist
-(NSString *) currentSong {
NSString *retVal = nil;
MPMusicPlayerController* iPodMusicPlayer = [MPMusicPlayerController iPodMusicPlayer];
MPMediaItem *mediaItem = [iPodMusicPlayer nowPlayingItem];
if (mediaItem) {
NSString *artist = [mediaItem valueForProperty: MPMediaItemPropertyArtist];
NSString *song = [mediaItem valueForProperty: MPMediaItemPropertyTitle];
retVal = [NSString stringWithFormat:@"NLT: %@ - %@", song, artist];
@betzerra
betzerra / gist:3421052
Created August 22, 2012 01:00
Steps to initialise a git repository and push to an existing remote repository
git init
git remote add origin https://github.com/username/Hello-World.git
#make some commits here
git push origin master
@betzerra
betzerra / gist:3184872
Created July 26, 2012 22:08
Objective-C fancy stuff for code
__attribute__ ((deprecated))
@betzerra
betzerra / resources.sh
Created June 11, 2012 15:15
Finds unused resources (images actually) from an XCode project
#!/bin/bash
# Found at http://gr3p.com/2012/06/encontrar-recursos-no-usados-en-un-proyecto-de-xcode
for i in `find . -name "*.png" -o -name "*.jpg"`; do
file=`basename -s .jpg "$i" | xargs basename -s .png | xargs basename -s @2x`
result=`ack -i "$file"`
if [ -z "$result" ]; then
echo "$i"
fi