This file contains hidden or 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
app: | |
name: <app-name> | |
type: node | |
env: | |
clear: | |
NODE_ENV: production | |
secret: | |
API_KEY |
This file contains hidden or 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
cities = ['BANGKOK', 'ALGIERS', 'ISTANBUL', 'NASSAU', 'JEDDAH', 'WINNIPEG', 'GUATEMALA CITY', 'YASUJ', 'EDMONTON', 'FECAMP', 'ROME', 'PLOVDIV', 'OSAKA', 'UTRECHT', 'DAR ES SALAAM', 'KUALA LUMPUR', | |
'MAZAR E SHARIF', 'SHANGHAI', 'TOKYO', 'LUCKNOW', 'HYDERABAD'] | |
current = cities.shift | |
until cities.empty? | |
cities.each_with_index do |city, index| | |
if city[0] == current[-1] | |
current = city | |
cities.delete_at(index) | |
end |
This file contains hidden or 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 bash | |
set -e -x | |
sudo apt-get update | |
sudo apt-get -y install libgnutls28-dev bzip2 make gettext texinfo gnutls-bin build-essential g++ | |
mkdir -p gnupg23 | |
pushd gnupg23 |
This file contains hidden or 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
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="pattern"> | |
<test name="lang" compare="contains"> | |
<string>th</string> | |
</test> | |
<test qual="any" name="family"> | |
<string>sans-serif</string> | |
</test> |
This file contains hidden or 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 'watir' | |
b = Watir::Browser.new | |
b.goto 'https://popcat.click' | |
i = b.images.first | |
loop do | |
i.click | |
sleep 0.04 # 8000 click per 5 mins ~= 1 click per 0.04s | |
end |
This file contains hidden or 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 'csv' | |
running_instances = `gcloud compute instances list | ack <node-name> | ack RUNNING` | |
parsed_instance_list = CSV.parse(running_instances.squeeze(' ').gsub(' ', ',')) | |
# instance name as key, region as value | |
instance_name_with_region = parsed_instance_list | |
.group_by do |a| | |
a[0] | |
end | |
.map do |k, v| |
This file contains hidden or 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 QualityCalculator | |
def self.calculate_for_normal_award(award) | |
# normal award logic here | |
# which would update the quality of the award passed in | |
return award | |
end | |
def self.calculate_for_blue_first_award(award) | |
# blue first award logic here | |
# which would update the quality of the award passed in |
This file contains hidden or 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
// rt = refund_transaction | |
// st = source_transaction (refunded transaction) | |
// rd = refund_details | |
// Mapper | |
public RefundWithSourceTransaction map(int index, ResultSet r, StatementContext ctx) { | |
RefundDetail refundDetail = new RefundDetail( | |
UUID.fromString(r.getString("rd.id")), | |
UUID.fromString(r.getString("rd.transaction_id")), | |
UUID.fromString(r.getString("rd.source_transaction_id")), |
This file contains hidden or 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
-- rt = refund_transaction | |
-- st = source_transaction (refunded transaction) | |
-- rd = refund_details | |
SELECT * | |
FROM transactions AS st | |
INNER JOIN refund_details AS rd | |
ON st.transaction_id = rd.source_transaction_id | |
INNER JOIN transactions AS rt ON rt.transaction_id = rd.transaction_id | |
WHERE st.transaction_id = :transactionId |
This file contains hidden or 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
set -e | |
cd | |
sudo apt update && sudo apt install -y build-essential zsh tmux libssl-dev libreadline-dev zlib1g-dev libpq-dev | |
# Setting up ZSH | |
chsh -s /usr/bin/zsh $USER | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# Setup Z |
NewerOlder