Farming: Finish quests
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 FindUnique | |
DEFAULT_MAX_COMBINATIONS = ((CHARACTERS.size ** UNIQUE_LENGTH) * 0.9) | |
TRY_THRESHOLD = 4 | |
UNIQUE_LENGTH = 6 | |
CHARACTERS = %w[A B C D E F G H I J K L 1 2 3 4 5 6] | |
def self.call | |
if Something.count > DEFAULT_MAX_COMBINATIONS | |
Rails.logger.warn "This app has used more than 90% of the possible " \ |
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
module AdminUsers | |
class Authenticate | |
extend LightService::Action | |
expects :email, :password, :otp_attempt | |
promises :admin_user | |
executed do |c| | |
admin_user = AdminUser.find_by(email: c.email) |
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
# ~/.zshrc | |
alias did="vim '+normal Go' '+w' '+r !date' '+w' ~/did.txt" |
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
salary = 3000 | |
puts "Tito: Noong 1980, #{salary} lang salary ko" | |
# > Tito: Noong 1980, 3000 lang salary ko | |
# Computed from CPI, source here https://docs.google.com/spreadsheets/d/1gPqRL2zKymVaOiWUqj3vMqc5FomahgbZdIsChcfq3Do/edit#gid=0 | |
# Starting in 1980 | |
inflation = [ | |
{ year: 1980, value: 18.20 }, | |
{ year: 1981, value: 13.08 }, |
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
#!/bin/bash | |
usage="Usage: ./list-old-hdfs-files.sh [path] [days]" | |
if [ ! "$1" ] | |
then | |
echo $usage; | |
exit 1; | |
fi | |
if [ ! "$2" ] |
This Rakefile will abuse your master branch. It will go against the usual git flow, if that doesn't ride well with you, don't use this.
Too much wrangling with the dependencies on the Gemfile. My user page isn't some big project that everyone would use. I figured it's worth enough to sacrifice "best practices" for version control. It's just a user page, I don't want to pull my hair out trying to figure out dependencies in the build server when I add additional gems.
Best answer in a reddit thread: https://www.reddit.com/r/AskReddit/comments/24vzgl/you_just_won_a_656_million_dollar_lottery_what_do/chba5nw
So, what the hell DO you do if you are unlucky enough to win the lottery?
This is the absolutely most important thing you can do right away: NOTHING.
Yes. Nothing.
DO NOT DECLARE YOURSELF THE WINNER yet.
NewerOlder