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
| $: (Dollar Colon) is basically a shorthand version of $LOAD_PATH. $: contains an array of paths that your script will search through when using require. | |
| $0 (Dollar Zero) contains the name of the ruby program being run. This is typically the script name. | |
| $* (Dollar Splat) is basically shorthand for ARGV. $* contains the command line arguments that were passed to the script. | |
| $? (Dollar Question Mark) returns the exit status of the last child process to finish. | |
| $$ (Dollar Dollar) returns the process number of the program currently being ran. | |
| $~ (Dollar Tilde) contains the MatchData from the previous successful pattern match. | |
| $1, $2, $3, $4 etc represent the content of the previous successful pattern match. | |
| $& (Dollar Ampersand) contains the matched string from the previous successful pattern match. | |
| $+ (Dollar Plus) contains the last match from the previous successful pattern match. | |
| $` (Dollar Backtick) contains the string before the actual matched string of the previous successful pattern match. |
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
| {:assetMainType "EQUITY", | |
| :assetSubType "COE", | |
| :callExpDateMap {}, | |
| :daysToExpiration 4.0, | |
| :dividendYield 0.0, | |
| :interestRate 3.8630000000000004, | |
| :interval 0.0, | |
| :isChainTruncated false, | |
| :isDelayed false, | |
| :isIndex false, |
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
| (weekly-csp | |
| (->> (accounts) | |
| first | |
| :securitiesAccount | |
| :currentBalances | |
| :buyingPowerNonMarginableTrade) | |
| ["HOOD" "COIN" "TSM"]) | |
| {:high ["HOOD" 104.85 105.0 4.97 2 1416], | |
| :low ["HOOD" 104.85 104.0 4.45 2 1277], |
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
| <? | |
| if(file_exists('/www/global/lockdown')) { | |
| if($_COOKIE['4chan_auser'] && $_COOKIE['4chan_apass'] && ($_POST['mode']=='usrdel'||$_GET['mode']=='latest')) { | |
| // ok | |
| } | |
| else { | |
| die('Posting temporarily disabled. Come back later!<br/>—Team 4chan (uptime? what\'s that?)'); | |
| } | |
| } | |
| include_once "./yotsuba_config.php"; |
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
| (ns u.schwab | |
| (:require | |
| [cheshire.core :as json] | |
| [hato.websocket :as ws] | |
| [clj-http.client :as http] | |
| [clojure.string :as str] | |
| [clojure.walk :as walk] | |
| [integrant.core :as ig] | |
| [ring.util.codec :as codec] | |
| [ring.util.response :as response])) |
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
| (defn pgobj->clj [^org.postgresql.util.PGobject pgobj] | |
| (let [type (.getType pgobj) | |
| value (.getValue pgobj)] | |
| (case type | |
| "json" (cheshire.core/parse-string value true) | |
| "jsonb" (cheshire.core/parse-string value true) | |
| "citext" (str value) | |
| value))) | |
| (extend-protocol next.jdbc.result-set/ReadableColumn |
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
| (defn between [from target to] | |
| (and (<= from target) (<= target to))) | |
| (defn calculate-loan-size | |
| [loan-amount] | |
| (cond | |
| (between 1 loan-amount 10000) :small | |
| (between 10001 loan-amount 50000) :modest | |
| (between 50001 loan-amount 150000) :large | |
| (>= loan-amount 150001) :jumbo)) |
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
| (def log-store (atom {})) | |
| (defn debug [tag val] | |
| (swap! log-store update-in [tag] #(conj (or % []) val)) | |
| val) | |
| (defn logs | |
| [tag & functions] | |
| (let [tag (if (number? tag) | |
| (nth (keys @log-store) tag) |
NewerOlder