Skip to content

Instantly share code, notes, and snippets.

class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
PixateFreestyle.initializePixateFreestyle
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = UIViewController.alloc.init
@window.styleMode = PXStylingNormal
@button = UIButton.buttonWithType UIButtonTypeSystem
.factory('TokenHandler', function() {
var tokenHandler = {};
var token = "none";
tokenHandler.set = function( newToken ) {
token = newToken;
};
tokenHandler.get = function() {
return token;
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title>
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var extractToken = function(hash) {
// with animation:
NSURLRequest *ur = [NSURLRequest requestWithURL:imageURL];
// to fade the image in automatically when it's loaded:
// http://stackoverflow.com/questions/13974226/afnetworking-fade-animation-on-image-while-scrolling-uitableview
[cell.imageView setImageWithURLRequest:ur placeholderImage:[UIImage imageNamed:@"placeholder.png"] success:^(NSURLRequest *request , NSHTTPURLResponse *response , UIImage *image ){
if (request) {
//Fade animation
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'
require 'bundler'
Bundler.require
require 'sugarcube-repl'
Motion::Project::App.setup do |app|
@chrise86
chrise86 / new.rb
Created August 11, 2014 15:16 — forked from GantMan/new.rb
def tableView(table_view, cellForRowAtIndexPath: index_path)
data_row = @data[index_path.row]
#cell = table_view.dequeueReusableCellWithIdentifier(ALERTS_CELL_ID) || begin
# rmq.create(AlertsCell, :alerts_cell, reuse_identifier: ALERTS_CELL_ID).get
#end
cell ||= AlertsCell.alloc.initWithStyle(UITableViewCellStyleSubtitle, reuseIdentifier:ALERTS_CELL_ID).autorelease
cell = rmq.build(cell, :alerts_cell).get
class MyCustomCell < UITableViewCell
# This method is used by ProMotion to instantiate cells.
def initWithStyle(style_name, reuseIdentifier: reuseIdentifier)
super
stylish
self
end
# A delegate method when the user clicks the Row(it's blue by default)
class MyCustomCell < UITableViewCell
# This method is used by ProMotion to instantiate cells.
def initWithStyle(style_name, reuseIdentifier: reuseIdentifier)
super
stylish
self
end
# A delegate method when the user clicks the Row(it's blue by default)
class MyCustomCell < UITableViewCell
# This method is used by ProMotion to instantiate cells.
def initWithStyle(style_name, reuseIdentifier: reuseIdentifier)
super
stylish
self
end
# A delegate method when the user clicks the Row(it's blue by default)
var scheduled = false,
_throttleDelay = 200;
function ScrollHandler(e) {
//throttle event:
if (!scheduled) {
scheduled = true;
setTimeout(function () {
console.log('scroll');