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 | |
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "typhoeus" | |
end | |
require "uri" |
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 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'liquid' | |
end | |
require 'date' | |
require 'liquid' |
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 'sidekiq/monitor' | |
Sidekiq::RetrySet.new.each do |job| | |
p [job.display_class, job.display_args] | |
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
# See https://support.freeagent.com/hc/en-gb/articles/115001222564-How-to-format-a-CSV-file-to-upload-a-bank-statement#h_01FWZVYY1GEEGAPKJHG6FKV2HM | |
require 'csv' | |
CSV($stdin, headers: true, skip_blanks: true) do |csv| | |
csv.each do |row| | |
puts([ | |
Date.parse(row['Date']).strftime("%d/%m/%Y"), | |
row['Amount'].gsub(/,/, ''), | |
row['Description'].gsub(/,/, '') |
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
<script> | |
/* eslint-disable */ | |
import { mode } from "$app/env"; | |
import { onMount } from "svelte"; | |
const rollbarAccessToken = import.meta.env | |
.VITE_ROLLBAR_POST_CLIENT_ITEM_ACCESS_TOKEN; | |
const codeVersion = import.meta.env.VITE_LATEST_SHA; |
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
migration_context = ActiveRecord::Base.connection.migration_context | |
migration_context.migrate(target_version = nil) | |
migration_context.rollback(steps = 1) | |
migration_context.forward(steps = 1) | |
migration_context.up(target_version = nil) | |
migration_context.down(target_version = nil) | |
migration_context.current_version |
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
def valid?(method, ...) | |
signature = method.inspect | |
pattern = %r{(?:\.|#)#{method.name}\(([^\)]*)\)} | |
params = signature.match(pattern)[1] | |
params_with_nil_default_values = params.gsub('...', 'nil') | |
klass = Class.new | |
klass.class_eval "def self.#{method.name}(#{params_with_nil_default_values})\nend\n" | |
klass.public_send(method.name, ...) | |
true | |
rescue ArgumentError => e |
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
def row_counts | |
Hash[*ApplicationRecord.connection.execute(%{ | |
ANALYZE; | |
SELECT | |
pgClass.relname AS tableName, | |
pgClass.reltuples AS rowCount | |
FROM | |
pg_class pgClass | |
INNER JOIN | |
pg_namespace pgNamespace ON (pgNamespace.oid = pgClass.relnamespace) |
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 | |
require 'pathname' | |
require 'fileutils' | |
pwd = Pathname.pwd | |
begin | |
source = Pathname.new(ARGV[0].nil? ? pwd : ARGV[0]).realpath | |
destination = Pathname.new(ARGV[1].nil? ? pwd: ARGV[1]).realpath |
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
10 REM 000000000000 | |
20 POKE 16514, 1 | |
30 POKE 16515, 141 | |
40 POKE 16516, 64 | |
50 POKE 16517, 17 | |
60 POKE 16518, 2 | |
70 POKE 16519, 0 | |
80 POKE 16520, 205 | |
90 POKE 16521, 107 | |
100 POKE 16522, 11 |
NewerOlder