Skip to content

Instantly share code, notes, and snippets.

View JakeAustwick's full-sized avatar

Jake Austwick JakeAustwick

  • Software Development
  • United Kingdom
View GitHub Profile
WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3
"8 + five is what?"
"13"
works
"8 + five is what?"
"13"
works
"In the number 4642513, what is the 3rd digit?"
"4"
works
195.154.161.89:3941
195.154.161.89:3942
195.154.161.89:3943
195.154.161.89:3944
195.154.161.89:3945
195.154.161.89:3946
195.154.161.89:3947
195.154.161.89:3948
195.154.161.89:3949
195.154.161.89:3950
>>> 'SitesView'.rstrip('View').rstrip('s')
'Site'
>>> 'SitesView'.rstrip('sView')
'Sit'
(function() {
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
var jake = nil;
(function(__base, __super){
// line 1, (file), class Person
function Person() {};
Person = __klass(__base, __super, "Person", Person);
var Person_prototype = Person.prototype, __scope = Person._scope;
_ajax_fetch_list_nonce ae00c9a72f
_ajax_nonce f80d273296
_ajax_nonce f80d273296
_ajax_nonce f80d273296
_ajax_nonce f80d273296
_ajax_nonce f80d273296
_ajax_nonce-add-meta eb16671e3f
_ajax_nonce-add-product_c... 343c0f98bb
_backorders no
_button_text
file1 = open(file1)
file2 = open(file2)
for l, l2 in zip(file1,file2):
if l[0] == l2[0]:
# do something
class User < ActiveRecord::Base
# Other stuff removed
belongs_to :plan
belongs_to :stripe_plan
def plan
self.stripe_token.to_s == "0" ? self.plan : self.stripe_plan
end
# Other stuff removed
>>> import gevent
>>> from gevent import socket
>>> urls = ['www.google.com', 'www.example.com', 'www.python.org']
>>> jobs = [gevent.spawn(socket.gethostbyname, url) for url in urls]
>>> gevent.joinall(jobs, timeout=2)
>>> [job.value for job in jobs]
['74.125.79.106', '208.77.188.166', '82.94.164.162']
$(':input').each(function(){
$(this).change(function(){
alert('hi');
});
})
class Product
def self.hello
'hello from the product class'
end
def hello
"hello from an instance, I'm a product with the ID #{self.id}"
end
end