Skip to content

Instantly share code, notes, and snippets.

View peteroome's full-sized avatar

Peter Roome peteroome

View GitHub Profile
<ul class="articleTabber">
<li><a href="#" data-tab="1" class="current">1</a></li>
<li><a href="#" data-tab="2">2</a></li>
<li><a href="#" data-tab="3">3</a></li>
<li><a href="#" data-tab="4">4</a></li>
<li><a href="#" data-tab="5">5</a></li>
</ul>
<div class='article-tab current' data-tab="1">
<h1>Page 1: Put anything you like in here.</h1>
@peteroome
peteroome / slownet.rb
Created July 24, 2012 09:04
Creates a slow network connection
#!/usr/bin/env ruby
print "Enter desired network speed (Kbit/s, e.g. 2000): "
speed = gets.strip.to_i
print "Enter desired latency (ms, e.g. 10): "
latency = gets.strip.to_i
print "Enter desired duration (how long do you want me to screw with your internet in seconds, e.g. 60): "
seconds = gets.strip.to_i
`sudo ipfw pipe 1 config bw #{speed}Kbits/s delay #{latency}ms`
`sudo ipfw add 1 pipe 1 src-port 80`
@peteroome
peteroome / front_end_developer_job_description_pandr.mdown
Created September 13, 2012 11:16
Freelance/Contract Front End Developer at PANDR

Freelance/Contract Front End Developer

PANDR are a small web design and development agency in Norwich, UK. We pride ourselves on the design and execution of beautiful and useable websites and applications. Our goal is always to exceed our clients expectations.

We're looking to enlist the services of really really (really!) talented front end developer for a 2 month period. You'll be working in partnership with a Ruby engineer, on a large code base (version controlled with Git), to deliver a beautiful interface for a client application. You'll also have the ability to work internally on PANDR projects too.

The ideal candidate profile combines a passion for UI/UX, great HTML/CSS/Javascript skills, a significant amount of perfectionism and the ability to finish projects and ship.

You must be able to demonstrate prior experience with examples of polished websites and applications that you're proud to show off. An ability to explain your use of Jav

@peteroome
peteroome / sha2_for_jon.php
Created October 14, 2012 17:03
Sha2 Example Test
case 'sha2':
if (hmac_hash("sha512", $pass, $saltFromDatabase) === $hashFromDatabase))
{
$retval = 1;
}
break;
@peteroome
peteroome / hyperlink_with_anchor.html
Created October 23, 2012 13:37
Hyperlink example with anchor
@peteroome
peteroome / access_control_allow_origin_amazon_s3
Created January 16, 2013 08:45
Access-Control-Allow-Origin Configuration on Amazon S3 to load Font Awesome from Rails app on Heroku.
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>http://mydomain.com</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
@peteroome
peteroome / cols_example
Created February 14, 2013 14:20
inline-block cols
<div class='col1'>
</div>
<!-- -->
<div class='col2'>
</div>
@peteroome
peteroome / FSocial
Last active December 16, 2015 01:19
Twitter Web Intents
class window.FSocial
constructor:->
@links = $ '.share-links'
@fbLink = $ '.facebook', @links
@channelUrl = @links.data('channel-url') + "/channel.html"
@bindTwitter()
@bindFacebook()
bindTwitter: () ->
reward = @rewardCredits
@peteroome
peteroome / student.rb
Created April 24, 2013 10:09
Searching. Building up a query
def self.search(params)
scope = scoped({})
scope = scope.scoped :where => ['title_id = ?', params[:title_id] ] unless params[:title_id].blank?
scope = scope.scoped :where => ['upper(first_name) like upper(?)', params[:first_name] ] unless params[:manufacturers].blank?
scope
end
@peteroome
peteroome / message.jeco
Created October 8, 2013 07:30
Spine Post & Messages, Chat Display.
<li class='item'>
<%= @body %>
</li>