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
public function drawArc(sprite:FlxSprite, centerX:Float, centerY:Float, radius:Float, startAngle:Float, arcAngle:Float, steps:Int):Void { | |
// | |
// Rotate the point of 0 rotation 1/4 turn counter-clockwise. | |
startAngle -= .25; | |
// | |
var twoPI = 2 * Math.PI; | |
var angleStep = arcAngle / steps; | |
// var xx = centerX + Math.cos(startAngle * twoPI) * radius; | |
// var yy = centerY + Math.sin(startAngle * twoPI) * radius; | |
var xx = centerX + radius * Math.cos(startAngle); |
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
" My bundles here: | |
" | |
" original repos on GitHub | |
" Bundle 'mileszs/ack.vim' | |
Bundle 'rking/ag.vim' | |
Bundle 'kien/ctrlp.vim' | |
Bundle 'mattn/gist-vim' | |
" Bundle 'Lokaltog/powerline' | |
" Bundle 'Lokaltog/powerline', {'rtp':'powerline/bindings/vim'} | |
Bundle 'ervandew/supertab' |
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
function parse_option_arguments(options) { | |
var installer_arguments = {}; | |
for(var i=0; i<options.length; i++) { | |
var option_arguments = options[i]; | |
var args = option_arguments.split(' '); | |
var regex = /\/(\w+)(=)?([0-9a-z-A-Z,]+)?/; | |
for(var j=0; j<args.length; j++) { | |
var arg = args[j]; | |
var match = regex.exec(arg); | |
var argument = match[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
require 'open-uri' | |
buf = open("https://raw.githubusercontent.com/libgdx/libgdx/master/CHANGES").read | |
md = buf.scan /\[(?<version>.+)\]/ | |
puts md[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
require 'open-uri' | |
buf = open("https://raw.githubusercontent.com/libgdx/libgdx/master/CHANGES").read | |
md = buf.match /\[(?<version>.+)\]/ | |
puts md['version'] |
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 ComercioParticipanteFilter(SimpleListFilter): | |
title = 'Comercio Participante' | |
parameter_name = 'com_participante' | |
def lookups(self, request, model_admin): | |
if request.user.is_superuser: | |
return (('Todos/as',''),) | |
# Esto lo vamos a usar en el futuro, para darle un <select> al admin. | |
# return [(x['num_com'], x['num_com']) for x in model_admin.model.objects.values("num_com").annotate(count=Count('num_com'))] | |
else: |
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 User < Ohm::Model | |
attribute :name | |
index :name | |
def self.fetch_by_field(field, values) | |
keys = to_indices(field, values) | |
command = Ohm::Command.new(:sunionstore, *keys) | |
Ohm::MultiSet.new(key, self, command) | |
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
configure :development do | |
require "sinatra/reloader" # First, a couple of dev-only requires | |
# Automatic reloading of files in the dev environment. Otherwise, it requires an app restart. | |
register Sinatra::Reloader | |
["helpers", "controllers", "models", "core_ext", "routes"].each do |folder| | |
Dir.glob("#{folder}/*.rb").each { |file| also_reload file } | |
end | |
#DataMapper::Model.raise_on_save_failure = true | |
enable :logging, :dump_errors | |
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
{ | |
name:"1391639613822", | |
powers: ["multiball", "multiball", "multiball", "multiball"], | |
map: | |
[[X, X, X, X, X, X, X, X, X], | |
[X, X, X, X, X, X, X, X, X], | |
[X, O, O, X, X, X, O, O, X], | |
[X, X, X, O, X, O, X, X, X], | |
[X, X, X, B, B, B, X, X, X], | |
[X, X, X, B, B, B, X, X, X], |
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
dirs = Dir['./*'] | |
original_dir = __dir__ | |
dirs.each do |dir| | |
begin | |
Dir.chdir(dir) | |
rescue | |
puts "couldn't change to #{dir}" | |
end | |
`git pull` |