Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

var local_hash = window.location.hash.substr(1),
hash_value = local_hash.substr(local_hash.indexOf(key + '=')).split('&')[0].split('=')[1],
Data = {};
// Once OAuth handshake is done, we'll be redirected with a hash string in the location that we'll use to extract the token
if (hash_value) {
Data.access_token = hash_value;
call_api("organizations", {}, function (data) {
console.log(data); // Here you have your organizations
#include <stdio.h>
#include "stdlib.h"
#include "string.h"
#include "sys/time.h"
#define SIZE (128*2048)
unsigned long long A[SIZE];
unsigned long long B[SIZE];
unsigned long long C[SIZE];
unsigned long long D[SIZE];
@jrom
jrom / test_generic.c
Created November 26, 2009 12:18
Code examples of OMP extensions for FPGA
/* Example 1, targeted code is a function */
#pragma omp target device(fpga) implements(matmul) copy_in( A[N], B[N] ) copy_inout( C[N] )
void matmul_fpga(int *A, int *B, int *C)
{
// Code that will run on the FPGA
}
#pragma omp task input( A[N], B[N] ) inout( C[N] )
void matmul(int *A, int *B, int *C)
{
@jrom
jrom / typus_demo.rb
Created November 30, 2009 17:16
Typus template
##
# $ rails example.com -m http://tr.im/typus_example
##
# Install Typus and friends.
plugin 'typus', :git => 'git://github.com/fesplugas/typus.git'
plugin 'acts_as_list', :git => 'git://github.com/rails/acts_as_list.git'
plugin 'acts_as_tree', :git => 'git://github.com/rails/acts_as_tree.git'
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
--- courier-0.47/maildrop/main.C.orig 2004-11-22 12:23:09.000000000 +0100
+++ courier-0.47/maildrop/main.C 2004-11-22 12:23:19.000000000 +0100
@@ -718,38 +718,6 @@
++i;
}
-#if HAVE_COURIER
- if (deliverymode && orig_uid == getuid())
- {
- const char *p;
require 'rubygems'
require 'wx'
class MyFrame < Wx::Frame
def initialize
super(nil, :title => "Thread example")
set_menu_bar menubar
timer = Wx::Timer.new(self, Wx::ID_ANY)
#!/bin/sh
# this file is a git post-update hook
# the file must be named post-update and be executable (chmod +x post-update)
# it must be in the .git/hooks directory
RAILS_ENV=production /path/to/retrospectiva/script/repository_syncer
echo "Retrospectiva was notified :-)"
select first_name, last_name, email, locale, time_zone from users INTO OUTFILE '~/contacts.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
require 'csv'
CSV.open("#{Rails.root}/../consumers.csv", "w") do |csv|
["Last login","Registration date","Organizations", "Projects count", "Organizations Plan", "name", "time_zone", "Language", "Email", "Phones", "Address"]
User.find_each(:include => [{:card => [:addresses, :phone_numbers]}, :organizations]) do |user|
print '.'
phones = []
if user.card
phones << user.card.phone_numbers.map(&:name).join(";") if user.card.phone_numbers
first_address = user.card.addresses.first
end
@jrom
jrom / devise.ca.yml
Created October 4, 2010 20:58 — forked from codegram/devise.ca.yml
Catalan translation for Devise
ca:
errors:
messages:
not_found: "no s'ha trobat"
already_confirmed: "ja està confirmat"
not_locked: "no està bloquejat"
not_saved:
one: "1 error ha evitat que %{resource} es pugui desar:"
other: "%{count} errors han evitat que %{resource} es pugui desar:"