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
#routes.rb | |
get "blog/category/:category/" => "posts#by_category", as: :post_category | |
get "blog/category/:category/index.html" => "posts#by_category" | |
get "blog/page-:page/" => "posts#index", as: :blog | |
get "blog/page-:page/index.html" => "posts#index" | |
get "blog/:slug/" => "posts#by_slug", as: :post_slug | |
get "blog/:slug/index.html" => "posts#by_slug" | |
get "blog" => "posts#index", as: :blog | |
get "blog/index.html" => "posts#index" |
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
``````````````````````````````````````````````````````````````````````......,::;;;''''''''++++++++++++++++++++++++++++'++''++++++++++++#++++#+++++++++++++++# | |
````````````````````````````````````````````````````````````````````````....,,::;;;'''''''++++++++++++++++++++++++++++++'''''+++++++++++++++++++++++++++++++# | |
````````````````````````````````````````````````````````````````````````....,,::;;;''''''''+++++++++++++++++++++++++++++'''''++++++++++++++++++'++++++++++++# | |
````````````````````````````````````````````````````````````````````````...,,,::;;;''''''''+++++++++++++'+++++++++++''++'''''''+''++'+++++++''''+++++++++++++ | |
````````````````````````````````````````````````````````````````````````...,,,::;;;;''''''''+++++++++''+'+++++''++''''''''''''''''''''+''+++'''''++++++++++++ | |
``````````````````````````````````````````````````````````````````````````..,,:::;;;;;;;'''''''++'''''''''''''''''''''''''''''''+''''''''''+''''''''''''+++++ | |
```````````````````````````````````````````````````````````````````````````. |
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
for t in `git tag` | |
do | |
arr=("keep_this" "keep_that" "and this") | |
if [[ "${arr[@]}" =~ ${t} ]]; then | |
echo keeping $t | |
else | |
git push origin :$t | |
git tag -d $t | |
fi | |
done |
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
{ "action": "closed", "number": 1, "pull_request": { "_links": { "comments": { "href": "https://api.github.com/repos/spajus/dailyscripts/issues/1/comments" }, "html": { "href": "https://github.com/spajus/dailyscripts/pull/1" }, "issue": { "href": "https://api.github.com/repos/spajus/dailyscripts/issues/1" }, "review_comments": { "href": "https://api.github.com/repos/spajus/dailyscripts/pulls/1/comments" }, "self": { "href": "https://api.github.com/repos/spajus/dailyscripts/pulls/1" } }, "additions": 6, "assignee": null, "base": { "label": "spajus:master", "ref": "master", "repo": { "archive_url": "https://api.github.com/repos/spajus/dailyscripts/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/spajus/dailyscripts/assignees{/user}", "blobs_url": "https://api.github.com/repos/spajus/dailyscripts/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/spajus/dailyscripts/branches{/branch}", "clone_url": "https://github.com/spajus/dailyscripts.git", "collaborators_url": "https://api |
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
vars = Object.methods | |
Benchmark.realtime { 100000.times { vars.map { |var| var.to_s } } } | |
=> 2.04459 | |
Benchmark.realtime { 100000.times { vars.map { |var| var.to_s } } } | |
=> 2.048889 | |
Benchmark.realtime { 100000.times { vars.map(&:to_s) } } | |
=> 1.917303 | |
Benchmark.realtime { 100000.times { vars.map(&:to_s) } } | |
=> 1.944543 |
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
Index: configure.ac | |
=================================================================== | |
--- configure.ac (revision 13700) | |
+++ configure.ac (working copy) | |
@@ -346,6 +346,12 @@ | |
DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}" | |
DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}" | |
;; | |
+ 13.*) | |
+ AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion]) |
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
#!/usr/bin/env ruby | |
require 'glusterfs' | |
50.times do | |
volume = GlusterFS::Volume.new('dist-volume') | |
volume.mount('distfs') | |
volume.unmount | |
_, size = `ps ax -o pid,rss | grep -E "^[[:space:]]*#{$$}"`.strip.split.map(&:to_i) | |
puts "Mem usage: #{size}" | |
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
require 'singleton' | |
require 'gosu' | |
class TestGameWindow < Gosu::Window | |
include Singleton | |
def initialize | |
super(640, 480, false) | |
self.caption = "Esc = quit" | |
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
class Player | |
def draw | |
@sprite.draw(@x, @y, 0) # Gosu::Image | |
# is there any way to find out value of @x and @y after all transformations it will go through? | |
end | |
end | |
class GameWindow < Gosu::Window | |
def draw | |
transform(@cam_x, @cam_y) do | |
scale(@cam_zoom_x, @cam_zoom_y, @cam_x, @cam_y) do |
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
stack level too deep | |
/Users/spajus/Dropbox/rubygamedev/manuscript/code/09-polishing/game_window.rb:11:in `update' | |
/Library/Ruby/Gems/2.0.0/gems/gosu-0.7.50/lib/gosu/swig_patches.rb:15:in `block (2 levels) in <class:Window>' | |
/Library/Ruby/Gems/2.0.0/gems/gosu-0.7.50/lib/gosu/swig_patches.rb:37:in `show' | |
/Library/Ruby/Gems/2.0.0/gems/gosu-0.7.50/lib/gosu/swig_patches.rb:37:in `show' | |
09-polishing/main.rb:28:in `<main>' |
OlderNewer