This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
################################################# | |
################################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder