Skip to content

Instantly share code, notes, and snippets.

View Sutto's full-sized avatar

Darcy Laycock Sutto

View GitHub Profile
@Sutto
Sutto / gist:29
Created July 20, 2008 20:38
undefined
We couldn’t find that file to show.
task :check_revision do
unless `git rev-parse HEAD` == `git rev-parse origin/master`
puts ""
puts " \033[1;33m**************************************************\033[0m"
puts " \033[1;33m* WARNING: HEAD is not the same as origin/master *\033[0m"
puts " \033[1;33m**************************************************\033[0m"
puts ""
end
end
@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'
#################################################
#################################################
@Sutto
Sutto / gist:943752
Created April 27, 2011 05:22
Resque Daemon Controller
#!/usr/bin/env ruby
ENV['RAILS_ENV'] ||= 'development'
require File.expand_path('../../config/environment', __FILE__)
require 'daemon_spawn'
class ResqueWorkerDaemon < DaemonSpawn::Base
def start(args)
@worker = Resque::Worker.new('*') # Specify which queues this worker will process
@Sutto
Sutto / _maps.sass
Created March 17, 2010 15:21
Unobtrusive Gmaps w/ html5 data attributes and rails 3
.gmap.map-preview
:width 540px
:height 400px
:margin 5px auto
:border 5px solid #DDD
:background #F1F1F1 url('/images/map-placeholder.jpg') center center no-repeat
@Sutto
Sutto / sickbeard-clean-library.rb
Created April 6, 2011 10:20
Moved a folder? Clean your sickbeard library...
require 'rubygems'
require 'sequel'
database = Sequel.connect('sqlite://sickbeard.db')
database[:tv_episodes].select(:location, :episode_id).exclude(:location => "").each do |show|
if !File.file?(show[:location])
database[:tv_episodes].filter(:episode_id => show[:episode_id]).delete
end
end
@Sutto
Sutto / about.md
Last active March 31, 2016 00:44
Buildkite Lambda Function

We use this flow with AWS lambda, combined with CloudWatch Scheduled Events, to trigger our builds periodically.

It's nice, avoids duplication and keeps everything together easily.

class ApiController < RocketPants::Base
# Override the json encoding mechanism to use Oj for mega-speed!
def encode_to_json(json)
Oj.dump json, mode: :compat
end
add_method_tracer :encode_to_json
end