Skip to content

Instantly share code, notes, and snippets.

View Pablo-Merino's full-sized avatar
🪛

Pablo Merino Pablo-Merino

🪛
View GitHub Profile
# Configure touchpads to use xf86-input-synaptics X input driver
Section "InputClass"
Identifier "touchpad"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "synaptics"
Option "MinSpeed" "0.4"
Option "MaxSpeed" "1.0"
Option "AccelFactor" "0.0035"
Option "HorizScrollDelta" "6"
def 😄(😡)
if 😡 == "😎"
puts "Yay UTF8!"
end
end
😛 = "😎"
😄 😛
$('.gallery_button a').click ->
console.log('y0')
dispatch_queue_t myQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(myQueue, ^{
[self performSelectorOnMainThread:@selector(someActionToUpdate:) withObject:an_object waitUntilDone:YES];
});
-(void)someActionToUpdate:(id)an_object {
// an_object can be any kind of type
}
@Pablo-Merino
Pablo-Merino / clear.rb
Created April 19, 2012 15:43
Clear screen on Ruby script
module Screen
def self.clear
print "\e[2J\e[f"
end
end
@Pablo-Merino
Pablo-Merino / Gemfile
Created April 10, 2012 15:47
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@Pablo-Merino
Pablo-Merino / count_lines.rb
Created March 10, 2012 12:23
Script to count the line numbers of all the files in the actual dir
total = 0
Dir["./**/*.*"].each do |f|
filenumber =%x{wc -l #{f}}.split.first
puts f+ " - "+count = filenumber
total = total + filenumber.to_i
end
puts "Total lines = #{total}"
@Pablo-Merino
Pablo-Merino / config.ru
Created March 1, 2012 16:25
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
require "rails"
#title {
position: absolute;
right: 300px;
top: 25px;
visibility: visible;
z-index: 0;
text-align: right;
font-weight: bold;
font-size: 50px;
font-family: Helvetica;
#title {
position: absolute;
right: 300px;
top: 25px;
visibility: visible;
z-index: 0;
text-align: right;
font-weight: bold;
font-size: 50px;
font-family: Helvetica;