Skip to content

Instantly share code, notes, and snippets.

@marcadams
marcadams / update_storyboard_strings.sh
Last active December 24, 2015 15:59 — forked from problame/update_storyboard_strings.sh
It seems in Xcode 5 that there was an issue with passing in the file path with a ./, changing the find command to use ${PWD} results in the absolute path being used. Apparently, ibtool prefers absolute paths. This also ignores any locale folders under a "Views" directory, which is where I put my XIB files. Otherwise, the XIB localization folders…
#!/bin/sh
#
# update_storyboard_strings.sh - automatically extract translatable strings from storyboards and update strings files
# Source: https://gist.github.com/marcadams/6825053
# Based on http://forums.macrumors.com/showpost.php?p=16060008&postcount=4 by mikezang
storyboardExt=".storyboard"
stringsExt=".strings"
newStringsExt=".strings.new"
oldStringsExt=".strings.old"
@marcadams
marcadams / gist:1670980
Created January 24, 2012 16:30 — forked from graemerocher/gist:1393603
Using GORM from MongoDB from a Groovy Script
@GrabResolver(name='grails-core', root='http://repo.grails.org/grails/core')
@Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT')
@Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1')
import grails.persistence.*
import org.grails.datastore.gorm.mongo.config.*
MongoDatastoreConfigurer.configure("myDatabase", Book)
Book.withSession {
@marcadams
marcadams / gist:1401101
Created November 28, 2011 17:01 — forked from graemerocher/gist:1393603
Using GORM from MongoDB from a Groovy Script
@GrabResolver(name='grails-core', root='http://repo.grails.org/grails/core')
@Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT')
@Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1')
import grails.persistence.*
import org.grails.datastore.gorm.mongo.config.*
MongoDatastoreConfigurer.configure("myDatabase", Book)
Book.withSession {
@marcadams
marcadams / gist:180329
Created September 3, 2009 14:27 — forked from heavysixer/gist:180328
will_paginate fix for facebooker from Heavysixer
class FacebookPaginator < WillPaginate::LinkRenderer
include WillPaginate::ViewHelpers
def stringified_merge(target, other)
other.each do |key, value|
key = key.to_s # this line is what it's all about!
next if "fb_sig_friends" == key
existing = target[key]
if value.is_a?(Hash) and (existing.is_a?(Hash) or existing.nil?)