View event_example.rb
require 'concurrent'
event = Concurrent::Event.new
t1 = Thread.new do
puts "t1 is waiting"
event.wait(1)
puts "event ocurred"
end
View convertToXml.java
public void convertToXml(AnyObject object)
throws JAXBException, FileNotFoundException
{
JAXBContext contextObj = JAXBContext.newInstance( PnrRetrieveResult.class);
Marshaller marshallerObj = contextObj.createMarshaller();
marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshallerObj.marshal(object, new FileOutputStream( "/tmp/result.xml"));
System.out.println("Done ");
}
View DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
// Emacs keybindings
"^ " = "setMark:";
"~d" = "deleteWordForward:";
"~w" = "copy:"; /* M-w */
"^w" = "deleteWordBackward:";
View stay_up_to_date_in_programming.md
View producer_consumer_problem.rb
BUFFER_SIZE = 100
semaphore = Mutex.new
require 'thread'
queue = Thread::Queue.new
class Item
attr_reader :data
def initialize
View KeyBindings.dict
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
// Emacs keybindings
"^ " = "setMark:";
"~d" = "deleteWordForward:";
"~w" = "copy:"; /* M-w */
"^w" = "deleteWordBackward:";
View DeccanRubyConf5K.md

Hi Runners,

We are going to meet tomorrow at 6:40am outside Hyatt Regency Entrance gate.

We will do quick warm up.

Run starts at 7am sharp from outside Hyatt

Here is the route https://www.strava.com/routes/2996162

View gist:4fae9b51f1d416504899
# https://github.com/docker/docker/issues/8710
brew install socat
brew cask install xquartz
open -a XQuartz
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
# in another window
docker run -e DISPLAY=192.168.59.3:0 jess/geary
View webpack.config.js
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
javascript: './public/javascripts/app.jsx'
},
output: {
path: __dirname + "/public",
filename: 'bundle.js'
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console