This file contains 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
namespace :blogify do | |
desc "Sync extra files from blogify plugin" | |
task :sync do | |
system "rsync -ruv vendor/plugins/blogify/db/migrate db" | |
end | |
end |
This file contains 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
# Filters added to this controller apply to all controllers in the application. | |
# Likewise, all the methods added will be available for all controllers. | |
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
# Este layout tem precedência sobre a convenção do rails. | |
layout 'blog' |
This file contains 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 'action_view' | |
require 'active_support' | |
require 'mustache' | |
class Mustache | |
# TODO - Think about allowing to overwrite layout methods in subclassing views | |
# | |
# http://github.com/defunkt/mustache/blob/master/lib/mustache/sinatra.rb#L79-82 | |
# http://github.com/defunkt/mustache/blob/master/lib/mustache/sinatra.rb#L96-102 |
This file contains 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 Pai | |
def self.mirrored_in(klass_name, &block) | |
klass = Class.new do | |
def bar | |
puts "bar" | |
end | |
end | |
klass.class_eval &block | |
Object.const_set klass_name, klass | |
end |
This file contains 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
# as we’re going to use Unicorn as the application server | |
# we’re not going to use common sockets | |
# but Unix sockets for faster communication | |
upstream shop { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a | |
# single worker for timing out). | |
# for UNIX domain socket setups: | |
server unix:/tmp/shop.socket fail_timeout=0; |
This file contains 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 'luarocks.require' | |
require 'mercury' | |
require 'haml' | |
module('fibonacci', package.seeall, mercury.application) | |
local templates = { | |
index = [[ | |
%html | |
%head |
This file contains 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 main | |
import ( | |
"bufio" | |
"flag" | |
"os" | |
"strings" | |
"launchpad.net/gobson/bson" | |
"launchpad.net/mgo" | |
"bytes" |
This file contains 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
seq 1 1000000 | xargs -n1 -P100 -I{} curl -d "i_answer=1544512" http://pt.fifa.com/theclub/polls/pollId=1544769/staticvote.htmx | |
# Inspired by https://github.com/vquaiato/better-fifa-raquer |
This file contains 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 java.io.File | |
import javax.imageio.ImageIO | |
import java.awt.image.BufferedImage | |
import java.awt.geom._ | |
import java.awt.Color | |
import java.awt.Font | |
import java.awt.Graphics2D | |
import java.util.Date |
This file contains 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
#include <cstdio> | |
#include <cstdlib> | |
extern "C" { | |
#include "lua.h" | |
#include "lauxlib.h" | |
#include "lualib.h" | |
#include "luajit.h" | |
} |
OlderNewer