Skip to content

Instantly share code, notes, and snippets.

const chunk_while = (input, predicate) =>
input.reduce((accumulator, current, index) =>
index > 0 && predicate(input[index-1], current) &&
[...accumulator.slice(0, accumulator.length-1), [...accumulator[accumulator.length-1], current]] ||
[...accumulator, [current]]
, [])
@jamesdaniels
jamesdaniels / facebook_session.rb
Created June 11, 2009 17:21
facebook authentication
def facebook_postback
if params[:session] && params[:session] != 'loggedout' && eval("params[:session] = #{params[:session].gsub(/\\"/, '"').gsub(/:/, ' => ')}")
access_denied unless verifed_facebook_autheticity(params[:session][:sig], {'expires' => params[:session][:expires], 'session_key' => params[:session][:session_key], 'ss' => params[:session][:secret], 'user' => params[:session][:uid]})
session = Facebooker::Session.create(APP_CONFIG[:facebook_api_key], APP_CONFIG[:facebook_api_secret])
facebook_user = Facebooker::User.new(params[:session][:uid], session)
begin
if logged_in?
link_facebook_account(facebook_user)
else
create_facebook_user(facebook_user)
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import * as firebase from 'firebase/app';
import { AngularFireAuth } from 'angularfire2/auth';
import { AngularFireStorage } from 'angularfire2/storage';
@Component({
selector: 'app-upload',
templateUrl: './upload.component.html',

Keybase proof

I hereby claim:

  • I am jamesdaniels on github.
  • I am jamesuriah (https://keybase.io/jamesuriah) on keybase.
  • I have a public key ASB-xFm8Id6qWZ6EDQ0BA9srwEy45ZRL3HAbpfFp3JT95wo

To claim this, I am signing this object:

require "minitest/autorun"
# Usage: IosVersion.new('11A4372q') #=> '7.0b1'
class IosVersion
IOS = {
'7' => [
3, {
'D' => [[1, 2]],
'E' => [[1, 3]],
Incident Identifier: [TODO]
CrashReporter Key: [TODO]
Hardware Model: iPod5,1
Process: Clock [3512]
Path: /var/mobile/Applications/BC0783D7-3F57-4317-A0C7-BCEBE1AB9632/Clock.app/Clock
Identifier: com.raizlabs.clockradio
Version: 2.3.5
Code Type: ARM
Parent Process: launchd [1]
Nov 2 15:12:46 Zurruchno installd[86] <Notice>: 0x16e1bb000 -[MIClientConnection installPath:withOptions:completion:]: Install of "/var/mobile/Media/Downloads/3117124869267619106/-7979392519707096209" type Customer requested by itunesstored (pid 308)
Nov 2 15:12:48 Zurruchno installd[86] <Notice>: 0x16e087000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.client.storegrunt; Version=3.22.00, ShortVersion=3.22.00>
Nov 2 15:12:48 Zurruchno misagent[414] <Notice>: attempt to install invalid profile: 0xe8008012
Nov 2 15:12:48 Zurruchno installd[86] <Error>: 0x16e087000 -[MIInstallableBundle _installEmbeddedProfileInBundle:]: Could not install embedded profile: 0xe8008012 (This provisioning profile cannot be installed on this device.)
Nov 2 15:12:48 Zurruchno installd[86] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Nov 2 15:12:50 Zurruchno installd[86] <Error>: 0x16e087000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:er
# Get a Continuous Integration Token on AppBlade.com
# while on your project details page. If you don't
# have a project yet, you'll have to create one.
CI_TOKEN=YOUR_PROJECTS_CI_TOKEN
BUNDLE_PATH=/path/to/bundle
# Optional arguments
ZIPPED_DSYM_PATH=/path/to/a/zipped/dsym
OVERRIDE_BUNDLE_VERSION_STRING=0.0.1
CHANGELOG="Some changes bro"
# Look up all the tags, grep for any on this commit, excluding jenkins-build tags
TAGGED_RELEASE=`git show-ref --tags --dereference | grep \`git rev-parse HEAD\` | awk '$2 !~ /refs\/tags\/jenkins(.+)\^\{\}/ { print $2 }'`
# Any results?
if [ -n "$TAGGED_RELEASE" ]
then
# If there was a match, we are on a tagged release (or many), normalize them, and grab the first one
GIT_TAG=`echo $TAGGED_RELEASE | tr "^{}" " " | tr "/refs/tags/" " " | awk -F" " '{print $1}'`
#!/bin/bash
# some variables we'll use later on
PROJECT_PATH=${WORKSPACE}/trunk
SIGNING_PATH=${PROJECT_PATH}/Signing
APP=Clock
XCODEPROJ_PATH="${PROJECT_PATH}/${APP}.xcodeproj"
XCODE_TARGET_NAME=${APP}.app
DSYM_NAME=${XCODE_TARGET_NAME}.dSYM
BUILD_PATH=${PROJECT_PATH}/build