Skip to content

Instantly share code, notes, and snippets.

View radamanthus's full-sized avatar

Radamanthus Batnag radamanthus

View GitHub Profile
@radamanthus
radamanthus / gist:5095797
Created March 6, 2013 00:48
RailsGirls followup activity
<This is a brain dump. Please forgive any typos>
I'd like to share an idea for a RailsGirls followup activity.
I noticed that having your stuff deployable and out on the net is a very powerful source of inspiration.
For me it makes me keep on working on it, just knowing that other people can see it.
One of the stumbling blocks in learning Rails is deployment. It's an advanced topic that is oddly too often taught in intro courses.
Forget about teaching deployment. Let's just give the newbs a ready-to-use VPS.
@radamanthus
radamanthus / phrug-names
Created March 7, 2013 05:09
PhRUG Celebrity Names
PhRUG Celebrity Names
Ricky Sta Cruz
Byron Bibat
Terry Ponce
Francis Magsipoc (aka Francis M)
Florence Magsipoc
Elmer Gaspar
Error Fornoles
Raymond Tayag
@radamanthus
radamanthus / increment_filenames.rb
Created March 29, 2013 08:27
Rename a batch of files that are following a sequential naming conventions, for example, a series of image files with names 9471_01_01.png..9471_01_29.png. Use this gist if you need to insert a file into the series. In this example, if you need to insert an 18th file, you will have to rename 9471_01_18.png to 9471_01_19.png, 19.png to 20.png, an…
file_prefix = ARGV[0]
file_suffix = ARGV[1]
start_file_index = ARGV[2].to_i
end_file_index = ARGV[3].to_i
file_ids = (start_file_index..end_file_index).to_a.reverse
file_ids.each do |i|
current_file_id = "%02d" % i
new_file_id = "%02d" % (i+1)
puts "Renaming #{file_prefix}#{current_file_id}#{file_suffix} to #{file_prefix}#{new_file_id}#{file_suffix}"
@radamanthus
radamanthus / gist:6669854
Last active December 23, 2015 17:39
DevOps Conscious Learning: Exercises and Resources
@radamanthus
radamanthus / gist:8055496
Created December 20, 2013 14:29
PHP Technical Interview Questions
We're building a classifieds site from scratch.
We want it to be a REST-ful site. Sketch the sitemap for the most common features of the site: posting ads and viewing ads.
We want to anonymously profile our users - OS, browser, screen size, location, etc. How do we do this? How do we collect the data, how do we store the data, and how do we analyze the data?
Assuming that we're storing everything on the RDBMS, based on the above requirements, sketch the data model for the site.
We want ads to display as fast as possible. We've heard that NoSQL is awesome fast. What NoSQL technology can we employ to improve ad display? How do we do it?
@radamanthus
radamanthus / gist:12f88d39abc870b83b21
Created August 1, 2014 04:20
Hourly request counts on an Nginx log file
# Usage: ruby nginx-requests.rb logfilename 31 Jul 2014
logfilename = ARGV[0]
day = ARGV[1]
month = ARGV[2]
year = ARGV[3]
hours = (0..24).to_a
hours.each do |hour|
default[:packages] = [
{:name => "dev-php/pecl-memcached", :version => "2.1.0-r1"},
{:name => "dev-php/pecl-apc", :version => "3.1.13"}
]
@radamanthus
radamanthus / CoreOSNotes
Created July 2, 2015 00:20
CoreOS Notes
### Get the Discover URL of a cluster
Run from within a node and get the value of `ETCD_DISCOVERY`
```
cat /run/systemd/system/etcd.service.d/20-cloudinit.conf
```

Keybase proof

I hereby claim:

  • I am radamanthus on github.
  • I am radamanthus (https://keybase.io/radamanthus) on keybase.
  • I have a public key whose fingerprint is BCD3 0B2B 3733 D620 6463 CB5F 2773 8C4B 60D3 D7FA

To claim this, I am signing this object:

@radamanthus
radamanthus / react-native-notes.md
Last active December 30, 2016 16:38
React Native Notes

This is a distillation of the lessons from The Complete React Native and Redux Course

The course is still by far the best introduction to React Native

But after going through the course sometimes I need to review some lessons. The online video format is not very conducive for reviews. Too many times I found myself wishing Stephen Girder wrote a companion book. He didn't, so, in the spirit of scratching my itch, I'm writing this. It's not a companion book, but a guide that I can refer to when I need to freshen up on some of the harder topics covered in the course.

Basic project

  • add ESLint
  • add development dependencies
  • use yarn instead of npm