Skip to content

Instantly share code, notes, and snippets.

@tarellel
tarellel / benchmark.rb
Created February 11, 2021 20:25
Ruby Single VS Double Quotes
require 'benchmark/ips'
Benchmark.ips do |x|
x.report('Single quotes') { 'String of Characters' }
x.report('Double Quotes') { "String of Characters" }
x.compare!
end
# Warming up --------------------------------------
@tarellel
tarellel / PiHole_Blocklists.txt
Created February 16, 2020 17:36
My PiHole DNS Setup lists
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://mirror1.malwaredomains.com/files/justdomains
http://sysctl.org/cameleon/hosts
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
https://hosts-file.net/ad_servers.txt
https://raw.githubusercontent.com/0Zinc/easylists-for-pihole/master/easylist.txt
https://raw.githubusercontent.com/0Zinc/easylists-for-pihole/master/easyprivacy.txt
https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt

Keybase proof

I hereby claim:

  • I am tarellel on github.
  • I am tarellel (https://keybase.io/tarellel) on keybase.
  • I have a public key whose fingerprint is 1D12 3F32 D4FD 78F5 8678 52B1 7E54 A8B2 5F1C FC0C

To claim this, I am signing this object:

{
"crimes":{
"case":{
"type": "Assault",
"case_id": "201500000000-1",
"happened_at": "05/28/2015 13:05:00",
"desc": "SIMPLE-ASSLT/BATT(OTH ASSLTS/NOTAGGRAVATED)",
"address": "900 N Municipal Dr"
},
@tarellel
tarellel / combos.txt
Created May 5, 2015 19:52
Number of nugget combos to get a 1000 nuggets
This file has been truncated, but you can view the full file.
| ----- | Package Sizes | ------ |
|4piece, 6piece, 10piece, 20piece|
| ----- | ----- | ----- | ------ |
[0, 0, 0, 50]
[0, 0, 2, 49]
[0, 0, 4, 48]
[0, 0, 6, 47]
[0, 0, 8, 46]
[0, 0, 10, 45]
@tarellel
tarellel / can_i_sleep.rb
Created November 16, 2014 17:53
Today is Sunday!
class Today
def initialize(kids = false)
@kids = kids
end
def sleepin?
if @kids == true
puts "Rise and shine!"
else
puts "What a life..."
@tarellel
tarellel / gist:3920773
Last active April 18, 2020 01:16 — forked from nodesocket/gist:3919205
World timezones in an HTML select element
<select name="timezone_offset" id="timezone-offset" class="span5">
<option value="-12:00">(GMT -12:00) Eniwetok, Kwajalein</option>
<option value="-11:00">(GMT -11:00) Midway Island, Samoa</option>
<option value="-10:00">(GMT -10:00) Hawaii</option>
<option value="-09:50">(GMT -9:30) Taiohae</option>
<option value="-09:00">(GMT -9:00) Alaska</option>
<option value="-08:00">(GMT -8:00) Pacific Time (US &amp; Canada)</option>
<option value="-07:00">(GMT -7:00) Mountain Time (US &amp; Canada)</option>
<option value="-06:00">(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
<option value="-05:00">(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
@tarellel
tarellel / optimize_images.rb
Created June 19, 2012 03:13 — forked from meleyal/optimize_images.rb
Simple png + jpg optimization script using optipng + jpegtran
#!/usr/bin/ruby
# Instructions
# - Install optipng + libjpeg (http://mxcl.github.com/homebrew/)
# - Put this file in a directory of images
# - Open in TextMate + run it (cmd+r)
# Config
# Everything you need to do to get started with Rails 2.3.8
#
# As of June 14th, 2010 @ 2:30 p.m. MST
#
# This gist now features instructions to get Rails 3 up and running with:
# - Ruby 1.8.7-p174
# - Bundler 0.9.26
# - Cucumber 0.8.0
# - Rspec 1.3.0 + Rspec-Rails 1.3.2
# - RVM
# Drop this file in config/initializers to run your Rails project on Ruby 1.9.
# This is three separate monkey patches -- see comments in code below for the source of each.
# None of them are original to me, I just put them in one file for easily dropping into my Rails projects.
# Also see original sources for pros and cons of each patch. Most notably, the MySQL patch just assumes
# that everything in your database is stored as UTF-8. This was true for me, and there's a good chance it's
# true for you too, in which case this is a quick, practical solution to get you up and running on Ruby 1.9.
#
# Andre Lewis 1/2010
# encoding: utf-8