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
module My | |
class RingBuffer | |
def initialize(size) | |
@size = size | |
@pointer = 0 | |
@buffer = Array.new | |
@mutex = Mutex.new | |
end | |
def push(value) |
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
const kinesisResponse = { | |
FailedRecordCount: 0, | |
Records: [{ SequenceNumber: 'test-sequence-number', ShardId: 'test-ShardId' }], | |
}; | |
sinon.stub(KinesisClient.prototype, 'recordToKinesisStream').returns(Promise.resolve(kinesisResponse)) |
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
{ | |
"data": [{ | |
"type": "articles", | |
"id": "1", | |
"attributes": { | |
"title": "JSON API paints my bikeshed!" | |
}, | |
"links": { | |
"self": "http://example.com/articles/1" | |
}, |
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
$ brew install chromedriver | |
######################### | |
Gemfile | |
group :test do | |
gem "chromedriver-helper" | |
gem 'selenium-webdriver' | |
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
desc 'delete all data from db except migrations' | |
task :truncate_db => :environment do | |
conn = ActiveRecord::Base.connection | |
postgres = "SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname='public'" | |
tables = conn.execute(postgres).map { |r| r['tablename'] } | |
tables.delete "schema_migrations" | |
tables.each { |t| conn.execute("TRUNCATE \"#{t}\" CASCADE") } | |
end |
- https://github.com/zheludkovm/LinuxJavaFixes
- http://superuser.com/questions/358749/how-to-disable-ctrlshiftu-in-ubuntu-linux
- disable HUD (~like start menu in windows) triggering on 'Alt' http://askubuntu.com/questions/122209/how-do-i-modify-or-disable-the-huds-use-of-the-alt-key
- if you still experience some shotcuts don't work as expected, check Keyboard->Shortcuts settings un Ubuntu and override them
- IBus(fix non working shortcuts with non-latin keyboard) http://onedev.net/post/469
- quick theme change ctrl+back quote, enter presentation mode, change keymap quickly(might be useful for pair programming)
- alt home navigation bar(quicker than tree navigation isn't it?), alt+insert to create file on the spot or folder or rails generator
- ctrl+shift+e recent files
- run action (ctrl+shift+A)
- find current file in project tree(Alt+f1)
- !!! ctrl+click(ctrl+b go to declaration) global navigation by classes and methods, including 3rd party sources and yard docs/comments!!! (edited)
- close block by clicking tiny minus, even if you're in the bottom of the block. Useful when you're dealing with big methods/json/xml
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
var blocksModule = (function () { | |
function pushSubNode(node, subNode) { | |
if (node.subNodes != null) { | |
node.subNodes.push(subNode); | |
} else { | |
node.subNodes = [subNode]; | |
} | |
} |