Skip to content

Instantly share code, notes, and snippets.

@ferclaverino
ferclaverino / gist:3703195
Created September 12, 2012 00:14
Hey, I am offline
homeNewsQuery.getNews()
.then(function (news) {
// mostrar noticias
}, function (error) {
Offline.goOfflineMode();
});
filename = ask_open_file
Shoes.app(:title => "Fotoyop",
:width => 800,
:height => 600,
:resize => true) do
stack do
title(filename)
para
@img = image(filename)
para
@ferclaverino
ferclaverino / fotoyop_chunky.rb
Created November 4, 2012 18:02
Image manipulation in shoes
Shoes.setup do
gem "chunky_png"
end
require "chunky_png"
Shoes.app(:title => "Fotoyop", :width => 800, :height => 600, :resize => true) do
stack do
title("fotoyop")
button("cargar imagen") do
@ferclaverino
ferclaverino / gist:4060353
Created November 12, 2012 16:34
Insert Windows Mobile Services
function insertArticle(article) {
var client = getMobileServiceClient();
var item = { text: article.title, img: article.backgroundImage };
client.getTable("MostViewed").insert(item);
}
function getMobileServiceClient() {
var client = new Microsoft.WindowsAzure.MobileServices.MobileServiceClient(
"https://myMobileServicesApp.azure-mobile.net/",
"myMobileServicesAppIdhKXrnRFpwu70"
@ferclaverino
ferclaverino / gist:4060395
Created November 12, 2012 16:41
Subscribe to WNS and register the channel
function subscribeToPushNotification() {
var channelOperation = Windows.Networking.PushNotifications
.PushNotificationChannelManager
.createPushNotificationChannelForApplicationAsync()
.then(function (newChannel) {
channel = newChannel;
// Insert the new channel URI into the Channel table.
var client = getMobileServiceClient();
var channelTable = client.getTable('Channel');
@ferclaverino
ferclaverino / fotoscopadas.rb
Created December 12, 2012 12:00
Realizado por Gaby, del colegio Nehen Peuman, Bariloche
Shoes.setup do
gem "chunky_png"
end
require "chunky_png"
Shoes.app(:title => "Fotos copadas", :width => 800, :height => 600, :resize => true) do
stack do
title("Fotos copadas")
button("Load") do
(function () {
"use strict";
function parseBenefit(text) {
var type = "otro";
var value = "";
if (text != "") {
var numberPattern = /\d+/g;
var result = text.match(numberPattern);
#include <DCMotor.h>
DCMotor motor0(M0_EN, M0_D0, M0_D1);
DCMotor motor1(M1_EN, M1_D0, M1_D1);
void setup()
{
}
void loop()
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mochacli: {
options: {
reporter: 'nyan',
bail: true
},
describe('a listener', function(){
describe('without nothing', function(){
it('does nothing', function(){
var userRepo = new UserRepo([]);
var listener = new listenerModule.Listener(userRepo);
listener.start();
});
});