This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var unshift = Array.prototype.unshift; | |
var splice = Array.prototype.splice; | |
var grid = []; | |
var used = []; | |
var new_grid = []; | |
grid.push([{type:"p", head : 1},{type:"c", head : 1},{type:"a", head : 2},{type:"o", head : 2}]); | |
grid.push([{type:"o", head : 1},{type:"a", head : 2},{type:"c", head : 2},{type:"p", head : 1}]); | |
grid.push([{type:"c", head : 1},{type:"p", head : 2},{type:"o", head : 2},{type:"a", head : 1}]); | |
grid.push([{type:"p", head : 1},{type:"c", head : 2},{type:"o", head : 2},{type:"a", head : 1}]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
#solution { | |
width: 600px; | |
margin: 0 auto; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
class Array | |
def rotate n | |
a =dup | |
n.times do a << a.shift end | |
a | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
skip_before_filter :beta | |
def facebook | |
@user = User.find_for_facebook_oauth(env["omniauth.auth"], current_user) | |
if @user | |
if @user.persisted? | |
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.rnaud.karma; | |
import java.util.ArrayList; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.AdapterView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date = $('meta[name=next_sale]').attr("content"); | |
end_date = Date.parse(date); | |
remaining_time = end_date - now; | |
if (remaining_time > 0) { | |
$("#box5").html('<div id="box_timer">Ivan est un gros anuf</div>'); | |
} else { | |
setInterval("updateTimer()", 1000); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AttributeSerializer | |
module ActiveRecordExtensions | |
module ClassMethods | |
def serializeable(serialized, serialized_accessors={}) | |
serialize serialized, serialized_accessors.class | |
serialized_attr_accessor serialized, serialized_accessors | |
default_serialized_attr serialized, serialized_accessors | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ChallengeViewController.m | |
// ikarma | |
// | |
// Created by Arnaud Ferreri on 4/23/12. | |
// Copyright (c) 2012 Onefeat. All rights reserved. | |
// | |
#import "ChallengeViewController.h" | |
#import <extThree20JSON/extThree20JSON.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "GPUImageBlendTone.h" | |
#import "GPUImage.h" | |
@implementation GPUImageBlendTone | |
- (id)init; | |
{ | |
if (!(self = [super init])) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (UIColor*) gradientFromColor:(UIColor*)c1 toColor:(UIColor*)c2 withHeight:(int)height | |
{ | |
CGSize size = CGSizeMake(1, height); | |
UIGraphicsBeginImageContextWithOptions(size, NO, 0); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); | |
NSArray* colors = [NSArray arrayWithObjects:(id)c1.CGColor, (id)c2.CGColor, nil]; | |
CGGradientRef gradient = CGGradientCreateWithColors(colorspace, (CFArrayRef)colors, NULL); | |
CGContextDrawLinearGradient(context, gradient, CGPointMake(0, 0), CGPointMake(0, size.height), 0); |
OlderNewer