Skip to content

Instantly share code, notes, and snippets.

Avatar

Julien Letessier mezis

View GitHub Profile
View threader.rb
#!/usr/bin/env ruby
#
# Thread, fork, and try to trigger deadlocks
#
def make_noise
$stdout.write("\000")
end
[1,2].each do
View frozen_string.rb
class FrozenString
module ClassMethods
def get(string)
@@repository ||= {}
@@repository[string.freeze] ||= new(string.freeze)
end
end
extend ClassMethods
def initialize(string)
View net.mezis.tunnels.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>net.mezis.tunnels</string>
<key>ProgramArguments</key>
<array>
@mezis
mezis / nav.html
Created May 13, 2014
Deriving from Bootstrap
View nav.html
<nav class="ht-navbar">
<div>
<a>Brand</a>
</div>
<div>
<ul>
<li><a>First tab</a></li>
<li><a>Second tab</a></li>
</ul>
</div>
View keybase.md

Keybase proof

I hereby claim:

  • I am mezis on github.
  • I am mezis (https://keybase.io/mezis) on keybase.
  • I have a public key whose fingerprint is 18F3 9C07 AF6D 731A 1D3B 04A0 FA02 40E8 5344 1C47

To claim this, I am signing this object:

@mezis
mezis / tex-live.md
Created Jun 30, 2015
Installed TeX Live packages
View tex-live.md

For reference, installed TeX Live packages as of 2015-06-30:

$ yum list installed | grep tex
tex-cm-lgc.noarch               0.5-17.1.el6           @base
tex-kerkis.noarch               2.0-23.el6             @base
tex-preview.noarch              11.85-10.el6           @base
texlive.x86_64                  2007-57.el6_2          @base
texlive-dvips.x86_64            2007-57.el6_2          @base
texlive-east-asian.x86_64       2007-57.el6_2          @base
@mezis
mezis / ec2-server.txt
Last active Aug 29, 2015
`ab` result for orderweb
View ec2-server.txt
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking deliveroo.co.uk (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
View gist:2780719
diff --git a/lib/tasks/gettext_rails.rake b/lib/tasks/gettext_rails.rake
index 28da8a4..ce63757 100644
--- a/lib/tasks/gettext_rails.rake
+++ b/lib/tasks/gettext_rails.rake
@@ -3,7 +3,10 @@ namespace :gettext do
task :updatepo do
require 'gettext_rails/tools'
require 'preprocessing_erb_parser'
- GetText.update_pofiles("housetrip", Dir.glob("{app,lib,assets}/**/*.{rb,erb,rjs}").sort, "housetrip 1.0.0")
+ paths = Dir.glob("{app,lib,assets}/**/*.{rb,erb,rjs}").reject { |path|
View gist:3550134
diff --git a/app/models/booking/messaging_trait.rb b/app/models/booking/messaging_trait.rb
index 7bec914..355cc0f 100644
--- a/app/models/booking/messaging_trait.rb
+++ b/app/models/booking/messaging_trait.rb
@@ -82,7 +82,7 @@ module Booking::MessagingTrait
self.host_conversation.all_messages.detect{|m| m.is_a?(Message::WithGuestBooking)}
guest_message = self.tenant_info_sheet.andand.message
- if guest_message && !created_already
+ if guest_message.present? && !created_already
View bm_dci_pounding.rb
require 'benchmark'
number_of_rails_methods = 300
@rails = Class.new do
number_of_rails_methods.times do |i|
class_eval <<-RUBY
def call#{"%02d" % i} # def call01
end # end
RUBY
You can’t perform that action at this time.