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
fetch('https://backend.otcmarkets.com/otcapi/market-data/active/current?page=1&pageSize=1000').then((res) => res.json()).then(({ records }) => { | |
const keys = [ 'symbol', 'item', 'itemDesc', 'tierId', 'tierName', 'tierCode', 'price', 'tradeCount', 'dollarVolume', 'shareVolume' ].join(','); | |
const values = records.map(r => [ r.symbol, r.item, r.itemDesc, r.tierId, r.tierName, r.tierCode, r.price, r.tradeCount, r.dollarVolume, r.shareVolume ].join(',')); | |
console.log([].concat(keys, values).join("\n")); | |
}).catch(console.log) |
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
function circle(radius) { | |
radius = radius || (-1*radius) || 1; | |
const quadrant1 = []; | |
const quadrant2 = []; | |
const quadrant3 = []; | |
const quadrant4 = []; | |
const DEGREE = radius / 90; | |
for(let x=0; x <= radius; x+=DEGREE) { |
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
function oscillate(intervals, threshhold) { | |
intervals = intervals || (-1*intervals) || 1; | |
threshhold = threshhold || (-1*threshhold) || 1; | |
const distance = threshhold * 2; | |
const minute = 60; | |
const rateOfChange = (distance / minute); | |
console.log({ intervals, threshhold, distance, rateOfChange }); |
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
/** | |
* Find the sum-total of even Fibonacci numbers | |
* | |
* @param max - (integer) that specifies the maximum term to count up to (cannot exceed 4 million) | |
* | |
* Example: | |
* sum_even_fibonacci(2) -> 2 | |
* sum_even_fibonacci(8) -> 10 | |
* sum_even_fibonacci(34) -> 44 | |
*/ |
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
(function($) { | |
if (!$) return; // bail if no jQuery | |
function initViewportJs() { | |
var bodyElement = $('body'); | |
function checkViewportJS(evt) { | |
var bodyWidth = parseInt(bodyElement.css('width')); | |
if (!bodyWidth) return false; |
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
<?php | |
use Illuminate\Auth\UserTrait; | |
use Illuminate\Auth\UserInterface; | |
use Illuminate\Auth\Reminders\RemindableTrait; | |
use Illuminate\Auth\Reminders\RemindableInterface; | |
use Reimy\Extensions\Html\UserFormTraits; | |
class User extends BaseModel implements UserInterface, RemindableInterface { |
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 | |
# | |
# bash < <(curl -s https://gist.github.com/jmervine/5407622/raw/nginx_w_lua.bash) | |
# Adapted from http://mervine.net/nginx-with-lua-module | |
# REQUIREMENT - uncomment if PCRE library is not already installed | |
# apt-get install libpcre3 libpcre3-dev | |
set -x |