Skip to content

Instantly share code, notes, and snippets.

bonyiii

Block or report user

Report or block bonyiii

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View list_units_spec.rb
describe "#list_units" do
let(:unit_list) do
'unit' => [
{
'name' => 'foo.service'
'currentstate' => 'a'
'desiredstate' => 'b'
'options' => 'c'
}
]
@bonyiii
bonyiii / facebook_graph_api.rb
Last active Aug 29, 2015 — forked from mikkabouzu/facebook_graph_api.rb
Facebook Graph API w/ Koala
View facebook_graph_api.rb
### app access token
graph = Koala::Facebook::OAuth.new APP_ID, APP_SECRET
graph.get_app_access_token # => APP_TOKEN
### create test users with permissions
test_users = Koala::Facebook::TestUsers.new app_id: APP_ID, secret: APP_SECRET
user = test_users.create true, 'email,user_birthday,user_posts', name: 'Bob'
# =>
# { "id" => USER_ID,
# "access_token" => USER_ACCESS_TOKEN,
View gist:ce2aab36f9badb0b4884
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
View cars_controller.js.coffee
class MyApp.CarsController extends Batman.ApplicationController
# Appears to work the same way MyApp.CarsIndexView#viewDidAppear
@afterAction only: "index", ->
$('table').dataTable()
index: (params) ->
@set('cars', MyApp.Car.get('all'))
View gist:9531930
# TODO
# tömbként tároljuk az lámpa sorokat
# lámp sorok tömbe tartalmazzák a state -ket
# másodperc alapján eldöntjük az első sort
# óra / 5 kidja a második sorban színes lámpák számát annyi indexet felkapcsolunk
# óra mod 5 vissza adja a harmadik sor szines lámpák számát
# perc / 5 negyedik sor minden 3 piros
# pert mod 5
#
class BerlinClock
@bonyiii
bonyiii / gist:7439733
Last active Dec 28, 2015
opensuse 12.3 tmux.conf with working bash history xterm shortcuts for ctrl + Up/Down
View gist:7439733
~/.tmux.conf
set-option -g default-terminal xterm-256color
set-window-option -g xterm-keys on
# The key was that
echo $TERM
# in tmux returned screen which is why ctrl+up did not looked up history now it is
xterm-256color
Though it works fine on ubuntu with echo $TERM screen
@bonyiii
bonyiii / gist:6184489
Created Aug 8, 2013
ruby multithread
View gist:6184489
http://speakmy.name/2013/04/02/concurrent-programming-and-threads-in-ruby-reading-list/
Concurrent Programming and Threads in Ruby - a reading list
02 April 2013
Many rubyists consider threads in Ruby as somewhat of an arcane knowledge, though in reality they’re a very well researched and understood concept. Of course, writing effective multithreaded concurrent programs requires certain amount of knowledge and discipline from the programmer, but there’s nothing that a smart one can’t learn if he wants to.
To help with the task, awesome @brainopia compiled a list of recommended reading on the topic of concurrency and threads. All kudos go to @brainopia, and the original list in Russian as available as a gist here:
View cucumber_hooks.rb
Before do |scenario|
DeferredGarbageCollection.start
end
After do |scenario|
DeferredGarbageCollection.reconsider
end
at_exit do
DeferredGarbageCollection.stop
@bonyiii
bonyiii / jobsworth i18n
Last active Dec 15, 2015
Jobsworth i18n
View jobsworth i18n
actions
activities
admin_stats
billing
common
companies
custom_attributes
customers
devise
email addresses
View gist:4130303
git clone svn://host/repo --stdlayout
git co -b local_trunk trunk
# pull
git svn rebase
#push
git svn dcommit
You can’t perform that action at this time.