Skip to content

Instantly share code, notes, and snippets.

View logicaroma's full-sized avatar

Ramin Mohammadi logicaroma

View GitHub Profile
@logicaroma
logicaroma / gistie.rb
Created October 27, 2011 11:27 — forked from martinisoft/gistie.rb
command-line posting to gist
#!/usr/bin/env ruby
# Made by Pieter de Bie <[email protected]>
# Based on a "Pastie" task by someone
require "tempfile"
GIST_URL = 'http://gist.github.com/gists'
GIST_LOGIN_URL = 'https://gist.github.com/session'
USERNAME = "martinisoft"
TOKEN = "6ef8395fecf207165f1a82178ae1b984"
@logicaroma
logicaroma / gist:1318638
Created October 27, 2011 02:30 — forked from yahelc/gist:1004702
Simpler Twitter Intents / Google Analytics Script
(function(){
var event_names = {
"click" : "" ,
"tweet" : "",
"retweet" : "source_tweet_id",
"follow" : "screen_name",
"favorite" : "tweet_id"
};
for(var event_name in event_names)
@logicaroma
logicaroma / Multi iTunes Users
Created October 27, 2011 00:16
AppleScript for allowing multiple Apple iTunes User Account on a machine
tell application "Keychain Scripting"
set myKeyChain to current keychain
set theKeyList to every generic key of myKeyChain whose description is "iTunes innlogging"
end tell
set theKeyNamesList to {}
repeat with x in theKeyList
copy name of x to the end of theKeyNamesList
end repeat
@logicaroma
logicaroma / ConfigPluginSpace.wiki
Created October 13, 2011 09:59
Set of gists for implementing jsdoc reporting in maven. from and using jsdock (http://code.google.com/p/jsdoctk-plugin/)

Introduction

Running jsdoctk plugin without changing your project pom. Sometimes I want to run jsdoc for a project just so that I can get some quick information on the used javascripts, but I don't want to stick another dependency in the pom of the project. Because I kept running into this when working only for a single short task on big projects I went and figured out how to configure maven to include jsdoctk-plugin in its' list of 'known plugins'.

Details

When you know what to do, it turns out to be really simple. All you have to do is add a few lines of xml to your 'settings.xml' which can be found in your 'user-directory'. On unix-like machines this would be at '~/.m2/settings.xml'.

Add the following xml:

 {{{

@logicaroma
logicaroma / jQuery Plugin Boilerplate
Created October 13, 2011 09:41
jQuery lightweight plugin boilerplate
/*!
* jQuery lightweight plugin boilerplate
* Original author: @ajpiano
* Further changes, comments: @addyosmani
* Licensed under the MIT license
* @link http://coding.smashingmagazine.com/2011/10/11/essential-jquery-plugin-patterns/
*/
// the semi-colon before the function invocation is a safety
// net against concatenated scripts and/or other plugins
@logicaroma
logicaroma / Rakefile
Created July 28, 2011 00:38 — forked from jfgomez86/Rakefile
Raketask for generating jsdoc documentation
desc "Generate Documentation"
task :doc do
root = File.dirname __FILE__
perl = %x[which perl].chomp
jsdoc_options = [
"--recursive",
"--directory #{root}/doc",
"--project-name AwesomeProject"
].join(" ")
@logicaroma
logicaroma / gist:967566
Created May 11, 2011 22:50
Remove all the subviews
NSEnumerator *enumerator = [itemViewContainer.subviews objectEnumerator];
UIView *subview;
while (subview = [enumerator nextObject]) {
[subview removeFromSuperview];
}
@logicaroma
logicaroma / SCAppUtils.h
Created May 11, 2011 22:50 — forked from scelis/SCAppUtils.h
Add a background image to your UINavigationBar.
#import <UIKit/UIKit.h>
#define kSCNavigationBarBackgroundImageTag 6183746
#define kSCNavigationBarTintColor [UIColor colorWithRed:0.54 green:0.18 blue:0.03 alpha:1.0]
@interface SCAppUtils : NSObject
{
}
+ (void)customizeNavigationController:(UINavigationController *)navController;
@logicaroma
logicaroma / UITextView With a Rounded Corner & Colored Border
Created May 11, 2011 22:29
UITextView With a Rounded Corner & Colored Border
[textView.layer setBackgroundColor: [[UIColor whiteColor] CGColor]];
[textView.layer setBorderColor: [[UIColor colorWithRed:224/255.0 green:224/255.0 blue:224/255.0 alpha:1.0] CGColor]];
[textView.layer setBorderWidth: 2.0];
[textView.layer setCornerRadius:8.0f];
[textView.layer setMasksToBounds:YES];
@logicaroma
logicaroma / forms.css
Created April 13, 2011 15:35
Forms.css Template from the BluePrint Framework
/* --------------------------------------------------------------
R.Mohammadi
13-04-2011
forms.css
* Sets up some default styling for forms
* Gives you classes to enhance your forms
Usage:
* For text fields, use class .title or .text
* For inline forms, use .inline (even when using columns)