Skip to content

Instantly share code, notes, and snippets.

View Sutto's full-sized avatar

Darcy Laycock Sutto

View GitHub Profile
@Sutto
Sutto / config.json
Last active September 16, 2020 10:48 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
import json
import requests
import pandas as pd
data = pd.read_csv('artists.csv',sep=';') # Reading data from csv
data = data.T.to_dict().values() # Converting dataframe into list of dictionaries
json_data = [] # Empty list to temporarily save the new data, and at the end write it into a new CSV
# Iterate through the imported data
from urllib.request import Request, urlopen
import ssl
from bs4 import BeautifulSoup
import pandas as pd
url = 'https://www.who.int/emergencies/diseases/novel-coronavirus-2019/media-resources/news'
#################################################
#################################################
class Decorator
def initialize(decorated)
@decorated = decorated
end
def method_missing(method, *args, &blk)
@decorated.send(method, *args, &blk)
end
#!/bin/sh
/Users/linus/Developer/bin/fetch.rb &
@Sutto
Sutto / cleaner.rb
Created December 30, 2010 08:37 — forked from thomasfedb/cleaner.rb
module AttrCleaner
module ModuleMixin
def self.included(base)
base.class_eval do
extend ClassMethods
alias_method_chain :write_attribute, :cleaner
end
end
module ClassMethods
@Sutto
Sutto / luhn.rb
Created December 16, 2010 03:10 — forked from thomasfedb/luhn.rb
def luhn_valid?(number)
return unless number.is_a?(String)
# Convert to a reversed list of digits
digits = number.scan(/\d/).map(&:to_i).reverse
# No numbers in the string
return false if digits.empty?
check_digit = digits.shift
# For each of the normal integers, compute the correct sum
final_digits = []
digits.each_with_index do |value, index|
# i'd like this
%article omg
= render partial: 'omg.coffee'
# to result in this
<article>
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
raise ENV["GEM_PATH"].inspect
rescue LoadError
# RVM is unavailable at this point.