Skip to content

Instantly share code, notes, and snippets.

View salimane's full-sized avatar

Salimane Adjao Moustapha salimane

  • Agbara Mimo, Ajili Africa, Meltwater
  • Africa, Benin, Rwanda, Ghana, Kenya, China
View GitHub Profile
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@salimane
salimane / gist:8958411
Last active August 29, 2015 13:56
ruby slow regex match
salimane at Salimanes-MacBook-Pro in ~
⚛ ruby --version
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]
salimane at Salimanes-MacBook-Pro in ~
⚛ cat regex.rb
regex = %r{^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$}
link = "https://www.facebook.com/DUSA.ve?ref=stream"
puts link =~ regex