Skip to content

Instantly share code, notes, and snippets.

@VincentRbbmnd
VincentRbbmnd / LOC
Last active December 4, 2018 22:20
Count LOC with Sublime Text
// find->find in files with RegEx enabled
^.*\S+.*$
// Where:
c:\your_folder\,*.php,*.phtml,*.js,*.inc,*.html, -*/folder_to_exclude/*
@ryancastro
ryancastro / fb_delete.js
Created February 25, 2014 21:57
Delete all of your Facebook activity. Uses the mobile interface rather than the normal browser interface because this way is much faster and reliable.
// Load Facebook's mobile activity log
// https://m.facebook.com/#{you}/allactivity?log_filter=all
// loads jQuery into Facebook
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// wait for jQuery to load up.
setTimeout(removeIt, 2000);
@samknight
samknight / fuzzyregex.js
Created February 7, 2014 14:39
Fuzzy Regex match
// This will allow unordered search terms to match relevant string
// e.g. Really Long String will be matched by
// - long string
// - long really
// - all ring
// ..etc
// I have used this anonymous function to override the matcher function in select2
function(term, text) {
@ryansobol
ryansobol / gist:5252653
Last active November 4, 2025 18:51
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@RaffaeleSgarro
RaffaeleSgarro / gist:4635795
Created January 25, 2013 16:30
Distribute tasks among assignees
# Python 2.x
import random
import itertools
tasks = ['account', 'gestione classi', 'registro insegnanti',
'registro di classe', 'corsi di studio', 'gestione materie', 'bacheca',
'giornalino', 'pon', 'gestione circolari', 'gestione locali',
'inventario', 'viaggi', 'tasse']
assignees = ["Marco", "Gabriele", "Raffaele"]
@thom4parisot
thom4parisot / anonymous-quora.js
Created August 3, 2012 21:40
Navigating Quora without being logged in
Array.prototype.forEach.call(document.querySelectorAll('[class*="blurred_answer"]'), function(el){ el.className = el.className.replace(/blurred_answer[^\s]*/g, '') })
(1..100).each do |i|
if i%3 == 0 and i%5 == 0 then puts "FizzBuzz"
elsif i%3 == 0 then puts "Fizz"
elsif i%5 == 0 then puts "Buzz"
else puts i
end
end
@tuzz
tuzz / dig.rb
Created August 3, 2012 21:18
Lookup hostnames of machines on your local subnet
1.upto(254).map.with_object({}) { |i, o| n = `dig -x 192.168.1.#{i} +short`; o[i] = n unless n.empty? }
@luislavena
luislavena / gist:3251384
Created August 3, 2012 20:49
Testing Ruby 2.0 on Windows

Prepare for Ruby 2.0, today

Ruby 2.0 is around the corner, estimated to be launch February 2013, for its 20th anniversary!

Wouldn't be great to be able to test Ruby 2.0 features and report possible bugs?

Things like Refinements, built-in ANSI coloring for Windows or even better, faster startup

Users of other OS like Linux and OSX already can install upcoming versions of RUby thanks to RVM and rbenv tools, but what about Windows?

@judofyr
judofyr / fizzbuzz.rb
Created August 1, 2012 21:37 — forked from JEG2/fizzbuzz.rb
Writing FizzBuzz with flip-flops
a=b=c=(1..100).each do |num|
print num, ?\r,
("Fizz" unless (a = !a) .. (a = !a)),
("Buzz" unless (b = !b) ... !((c = !c) .. (c = !c))),
?\n
end