Skip to content

Instantly share code, notes, and snippets.

@farmisen
farmisen / main.rb
Created July 8, 2012 03:50
pvr.ccz sprite sheet extractor
require 'rubygems'
require 'json'
require 'chunky_png'
PLUTIL = '/usr/bin/plutil'
TEXTUREPACKER = '/usr/local/bin/TexturePacker'
dir = File.join(ARGV[0], '*plist')
out_dir = File.join(Dir.pwd , ARGV[1])
tmp_dir = "/tmp"
@farmisen
farmisen / LICENSE
Created February 9, 2013 07:03 — forked from jamztang/LICENSE
Copyright (c) 2011-2012 James Tang ([email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH TH
category->level = level;
needFlush = true;
int learnerId = [[[[LearnerCoordinator sharedInstance] currentLearner] learnerId] intValue];
NSString *key = [NSString stringWithFormat:@"learning_model.%d.%s.%s.dimension", learnerId, _currentGame->name.c_str(), name.c_str()];
// NSString *key = [NSString stringWithFormat:@"learning_model.%s.%s.dimension", _currentGame->name.c_str(), name.c_str()];
CCUserDefault::sharedUserDefault()->setIntegerForKey([key UTF8String], level);
//
// WAFirstViewController.m
// WeatherApp
//
// Created by demo on 7/23/13.
// Copyright (c) 2013 Mohit Sadhu. All rights reserved.
//
#import "WACurrentLocationViewController.h"
#import "YOSSocial.h"
# Installing Chrome
curl -L -O "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg"
hdiutil mount -nobrowse googlechrome.dmg
cp -R "/Volumes/Google Chrome/Google Chrome.app" /Applications
hdiutil unmount "/Volumes/Google Chrome"
rm googlechrome.dmg
# Installing Firefox
curl -L -o Firefox.dmg "http://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US"
hdiutil mount -nobrowse Firefox.dmg
module Devise
module Models
module RemoteAuthenticatable
extend ActiveSupport::Concern
#
# Here you do the request to the external webservice
#
# If the authentication is successful you should return
# a resource instance
@farmisen
farmisen / devise.rb
Created August 28, 2014 21:17 — forked from elarex/devise.rb
Devise.setup do |config|
config.mailer_sender = "[email protected]"
require 'devise/orm/active_record'
config.case_insensitive_keys = [ :email ]
config.strip_whitespace_keys = [ :email ]
config.skip_session_storage = [:http_auth]
config.stretches = Rails.env.test? ? 1 : 10
config.reconfirmable = true
config.password_length = 8..128
config.reset_password_within = 6.hours
Request:
PUT /documents/102842/escalate HTTP/1.1
Host: spark.stg.circleone.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-CSRF-Token: 7bAOu9aO+qXXPpZaX1hpSrOze7W2bT7Vbwvsmv/tEkE=
Content-Type: application/json; charset=UTF-8
X-Requested-With: XMLHttpRequest
[user]
email = YOUR EMAIL
name = YOU NAME
[branch]
autosetuprebase = always
[commit]
template = /Users/YOUR HOME DIRECTORY NAME/.gitmessage.txt
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
@farmisen
farmisen / index.js
Last active August 13, 2016 23:58
upload file to gcloud
// Install the gcloud CLI from https://cloud.google.com/sdk/downloads
// then login by doing gcloud auth login [email protected]
import fs from 'fs'
...
.use('/test', async(ctx, next) => {
console.log("IN TEST!")
const CLOUD_BUCKET = 'occamzrazor';