Skip to content

Instantly share code, notes, and snippets.

View dcinzona's full-sized avatar
🏠
Working from home

Gustavo Tandeciarz dcinzona

🏠
Working from home
View GitHub Profile
CmdUtils.CreateCommand(
{
name: "wiodsearch",
takes: {"query": noun_arb_text},
icon: "http://s.wordpress.org/favicon.ico?2",
homepage: "http://wiod.us/",
author: {name: "Gustavo Tandeciarz", email: "dcinzona@gmail.com"},
license: "MPL,GPL",
description: "Search WIOD Blog",
help: "Enter search",
@dcinzona
dcinzona / gist:1628893
Created January 17, 2012 21:11
Creating arbitrarily-colored icons from a black-with-alpha master image (iOS)
// Usage example:
// input image: http://f.cl.ly/items/3v0S3w2B3N0p3e0I082d/Image%202011.07.22%2011:29:25%20PM.png
//
// UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]];
// .h
@interface UIImage (IPImageUtils)
+ (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color;
@end
@dcinzona
dcinzona / gist:1630286
Created January 18, 2012 01:49
Fix for MKiCloudSync Crash
+(void) updateToiCloud:(NSNotification*) notificationObject {
NSMutableDictionary *dict = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] mutableCopy];
for(NSString *keyName in dict.allKeys){
NSString *keysToRemove = @"com.apple.audio.CoreAudio";
NSInteger kL = keysToRemove.length;
if(keyName.length>kL){
NSString *keySub = [keyName substringToIndex:kL];
if([keySub isEqualToString:keysToRemove]){
[dict removeObjectForKey:keyName];
@dcinzona
dcinzona / stripNewLine.php
Created April 23, 2012 23:41
Strip new line characters from PHP string
function removeRN($string){
$string = str_replace("\n", "", $string);
$string = str_replace("\r", "", $string);
return $string;
}
@dcinzona
dcinzona / Xcode4HockeyAppTestFlightintegration.sh
Created April 26, 2012 01:12 — forked from c0diq/Xcode4HockeyAppTestFlightintegration.sh
Automatic TestFlight/HockeyApp Upload XCode Script
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Inspired by original script by incanus:
# https://gist.github.com/1186990
#
# Rewritten by martijnthe:
# https://gist.github.com/1379127
#
@dcinzona
dcinzona / DataManager.h
Created July 18, 2012 11:55 — forked from rojotek/DataManager.h
Core Data singleton manager class capable of being run from a static library - updated for ARC.
// DataManager.h
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
extern NSString * const DataManagerDidSaveNotification;
extern NSString * const DataManagerDidSaveFailedNotification;
@interface DataManager : NSObject {
}
@dcinzona
dcinzona / google-weather-api-conditions.xml
Created August 24, 2012 12:14 — forked from bzerangue/google-weather-api-conditions.xml
Google Weather API Conditions List
<?xml version="1.0" encoding="UTF-8"?>
<!--Google Weather API Conditions. Compiled by Dennis Delimarsky, http://dennisdel.com/content/conditions.xml-->
<!--Tweaked by Brian Zerangue, February 1, 2011-->
<conditions>
<type handle="partly-sunny">Partly Sunny</type>
<type handle="scattered-thunderstorms">Scattered Thunderstorms</type>
<type handle="showers">Showers</type>
<type handle="scattered-showers">Scattered Showers</type>
<type handle="rain-and-snow">Rain and Snow</type>
<type handle="overcast">Overcast</type>
@dcinzona
dcinzona / rdbmsImport
Last active October 4, 2016 13:10
Neo4j RDBMS Import
= SQL --> Neo4j
The main goal is to be able to import data from SQL (or similar RDBMS) into Neo4j, while maintaining Foreign Keys as relationships, using Cypher. The reason behind using cypher vs. the batch importer is because I want to build a system that allows for multiple imports and updates without having to batch process it.
//console
= Table Structure Requirements:
1. Primary Key column names should use the pattern [TableName]+Id, so for a Contact table, the primary key field should be names ContactId. This is to prevent overlap of Node Labels.
@dcinzona
dcinzona / es-deploy.sh
Last active August 29, 2015 14:15
ElasticSearch deployment script with nginx ready for Kibana using Azure File Service for config/web/data storage
#!/usr/bin/env bash
tput setaf 8
##DEFAULT environment variables
AZURESTORAGEACCOUNT='null'
AZURESTORAGEPASSWORD='null'
AZUREFILESHARE='elasticsearch'
ELASTICSEARCH_VERSION=1.4.3
KIBANA_VERSION=3.1.2 #Unused currently
@dcinzona
dcinzona / DropSQLTablesWithPrefix.sql
Created February 12, 2016 11:41
Drop SQL Tables with Prefix
declare @cmd varchar(4000)
declare cmds cursor for
select 'drop table [' + Table_Name + ']'
from INFORMATION_SCHEMA.TABLES
where Table_Name like 'prefix%'
open cmds
while 1=1
begin
fetch cmds into @cmd