Skip to content

Instantly share code, notes, and snippets.

View kattrali's full-sized avatar

Delisa kattrali

View GitHub Profile
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
{
shouldReloadCollectionView = NO;
blockOperation = [NSBlockOperation new];
}
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id<NSFetchedResultsSectionInfo>)sectionInfo
atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
{
__weak UICollectionView *collectionView = self.collectionView;
###
# Scheme code is translated to YARV byte code, then evaluated in the
# Ruby Virtual Machine
require 'rbconfig'
require 'dl'
require 'fiddle'
require 'strscan'
class RubyVM
class MyGroupedListController < UIViewController
attr_accessor :posts
attr_accessor :sections
class TableViewSection
attr_accessor :title
attr_accessor :items
def initialize(params={})
@title = params[:title]
@kattrali
kattrali / a.md
Created June 29, 2012 12:52 — forked from rkh/a.md

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Netflix
  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
@kattrali
kattrali / gist:3004803
Created June 27, 2012 15:22 — forked from maddockpa/gist:3004769
Ajax and jquery get request
// target request:
// http://nominatim.openstreetmap.org/reverse?format=xml&lat=40.004&lon=-82.862&MaxResponse=1&zoom=17&accept-language=en-us&addressdetails=1
var getMyData = (function() {
var lat = document.forms[0].lat.value;
var lng = document.forms[0].lon.value;
return {format:"xml",lat:lat,lng:lng,MaxResponse:1,zoom:17,"accept-language":"en-us",addressdetails:1};
})
var submitForm = function() {
@kattrali
kattrali / bridge.rb
Created May 8, 2012 22:26 — forked from andreif/bridge.rb
bridgesupport
require "hpricot"
require "fileutils"
module BridgeSupport
class Parser
def initialize(path_from, path_to)
@doc = open(path_from) {|f| Hpricot(f).search('signatures').first}
if @doc and @doc.children
FileUtils.mkdir_p File.dirname(path_to)
o = open(path_to, 'w')
#export GRAILS_VERSION="$(ls -lhr $HOME/.grails | egrep -i '1\.' | head -1 | gawk '{print $9 }')"
export GRAILS_VERSION=`cat $GRAILS_HOME/build.properties | grep "^grails.version=" | awk -F= '{ print $2 }' | tr -d '\r' | tr -d '\n'`
_get_domain_classes(){
find ./grails-app/domain -iname *.groovy 2> /dev/null | tr \\n ' ' | sed 's/\.groovy//g' | sed 's/\.\/grails-app\/domain\///g' | tr '/' \.
}
_get_tests(){
find ./test -iname *.groovy 2> /dev/null | sed 's/\.\/test\/integration\///g' | sed 's/\Tests.groovy//g' | tr '/' \.
}
/**
* jQuery.support.cssProperty
* To verify that a CSS property is supported (or any of its browser-specific implementations)
*
* @param string p - css property name
* [@param] bool rp - optional, if set to true, the css property name will be returned, instead of a boolean support indicator
*
* @Author: Axel Jack Fuchs (Cologne, Germany)
* @Date: 08-29-2010 18:43
*
@kattrali
kattrali / whazzup.rb
Created January 26, 2011 11:57 — forked from cyberfox/whazzup.rb
Asks for status every 15-25 minutes to track where time goes. Traps USR2 to wake and prompt for status. Designed for Linux, works on OS X, needs tweaks for Windows. Uses JRuby, since it's the only easy-to-get cross-platform UI toolkit for Ruby.
require "java"
java_import javax.swing.JOptionPane
class Whazzup
def initialize(file = "#{ENV['HOME']}/snippets.txt")
@snippets ||= open(file, 'ab')
log('[Starting up (ruby)]')
thread_loop = Thread.current
package com.sporkmonger.rmud.swt.custom;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.LineStyleEvent;
import org.eclipse.swt.custom.LineStyleListener;
import org.eclipse.swt.custom.StyleRange;