Skip to content

Instantly share code, notes, and snippets.

View carchrae's full-sized avatar
🌄
again

Tom Carchrae carchrae

🌄
again
View GitHub Profile
/**
steps: (for ubuntu. most shells should be similar)
1) install heroku cli (eg, `npm i -g heroku`)
2) log in (`heroku login`)
3) list apps: `heroku apps > apps.txt`
4) run this script: `node heroku-export.js | bash`
you may want to run step 4 and verify the commands before piping it into bash
// go to https://twitter.com/settings/your_twitter_data/twitter_interests
// paste into dev tools console
const checks= [...document.querySelectorAll("div > input[type='checkbox']:checked")];
function queueNext(limit){ setTimeout(()=>{ checks.shift().click(); queueNext(limit+=1000); }, limit); }
queueNext(10000);
@carchrae
carchrae / minecraft-sleep.sh
Last active July 30, 2023 15:25
stop (pause) inactive minecraft server process
#!/bin/bash
# /home/minecraft/bin/minecraft-sleep.sh
#set -v
cd "$(dirname "$0")"
# service name (i'm using systemd)
SERVICE_NAME="$1"

Coding Challenge - The Cheapest Stopover

You're a jetsetting high flyer who is nearly always on the move. You often end up sleeping in airports due to poor flight connections. Your task is to build an application to find the cheapest hotel near an airport on a particular date. This will allow you to spend more time in a comfy bed and less time on the airport floor!

Specific Goal

Build a simple server that, given an airport code (eg, YVR) and a date, will return the three cheapest hotel rooms. (in case one is booked up or doesn't like the look of you). Make sure your output only contains the required information, the name of the hotel, address, phone number, and the rate for a room.

Please provide instructions on how to build and execute your project.

@carchrae
carchrae / send.sh
Last active May 18, 2018 13:43
sending with bitcoind like things
#!/bin/bash
set -v
# description on how this works
# requires the tool `bc` to be installed, and obviously, the coin cli
#
# https://stackoverflow.com/questions/38493893/heres-how-to-send-raw-transaction-btc-using-bitcoin-cli-command
# path to the command you are using
CLI="./bitcoin-cli"
@carchrae
carchrae / LPToken.sol
Last active September 23, 2017 22:33 — forked from anonymous/LPToken.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.15+commit.bbb8e64f.js&optimize=true&gist=
pragma solidity ^0.4.11;
import 'zeppelin-solidity/contracts/token/MintableToken.sol';
contract LPToken is MintableToken {
string public name = "Frontier LP Token";
string public symbol = "FPLP";
uint256 public decimals = 18;
}
0x62658C20146168741c1aB8B94Af8882c29b9A11C
@carchrae
carchrae / index.html
Last active May 23, 2017 22:39
map locator
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Carto Map</title>
<link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css"/>
<script src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"></script>
<style>
html, body, #map {
/*
resetting main.scss stuff
*/
input[type="text"], input[type="password"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="week"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="time"], input[type="url"], input[type="color"], textarea {
height: auto;
background-color: #ffffff;
}
/*
input[type="text"],
GIT
remote: git://github.com/spree/spree_auth_devise.git
revision: b554f307e5aa887110a70d54f8967c284f881375
branch: 3-0-stable
specs:
spree_auth_devise (3.0.0)
devise (~> 3.4.1)
devise-encryptable (= 0.1.2)
json
multi_json