Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicolas Mérouze nmerouze

View GitHub Profile
View gist:407623
var SplitView;
SplitView = {};
SplitView.masterButton = Ti.UI.createButton({
title: 'Open Window',
height: 50,
width: 200
});
SplitView.detailButton = Ti.UI.createButton({
title: 'Open Window',
height: 50,
View gist:308914
import com.mongodb.Mongo
import com.mongodb.DBCollection
import com.mongodb.BasicDBObject
import com.mongodb.DBObject
import com.mongodb.DBCursor
import com.mongodb.DB
import java.util.Set
import java.util.List
View environment_md.rb
config.gem "mongoid"
config.gem "mongo_session_store"
View controller.js
/* Requirements */
require.paths.unshift("./vendor/ejsgi/lib");
require.paths.unshift("./vendor/node-scylla/lib");
var scylla = require("scylla"),
ejsgi = require("ejsgi");
/* Controller */
var HomeController = {
index: function(req) {
View gist:299339
namespace :db do
desc "Migrate the database through scripts in db/migrate and update db/schema.rb by invoking db:schema:dump. Target specific version with VERSION=x. Turn off output with VERBOSE=false."
task :migrate => :environment do
ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
ActiveRecord::Migrator.migrate("db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
Rails.application.railties.engines.each do |engine|
ActiveRecord::Migrator.migrate(engine.root + "db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
end
Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
end
View Gemfile
gem "rails-cache", :require => "rails/cache", :path => "../rails-cache"
View step1.rb
require 'vendor/gems/environment'
require 'cramp/controller'
require 'uuid'
require 'mq'
Cramp::Controller::Websocket.backend = :thin
class TweetsController < Cramp::Controller::Websocket
end
View gist:278104
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script>
$(function() {
var canvas = document.createElement("canvas");
var img = new Image();
View step1.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function displayTweets(data) {
$("#loading").remove();
$.each(data.results, function(i, item) {
$("#tweets").append($("<li/>").text(item.text));
You can’t perform that action at this time.