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
const data = require('./data.json'); | |
const getFrequency = (arr) => { | |
const dict = {}; | |
arr.forEach(function(el) { | |
if (!dict[el]) dict[el] = 0; | |
dict[el]++; | |
}); | |
return { | |
leastFrequent: `${Object.keys(dict).find(key => dict[key] === Math.min(...Object.values(dict)))}`, |
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
const data = require('./data.json'); | |
const results = data.data.reduce((acc, val, idx, arr) => { | |
const [direction, rawValue] = val.split(' '); | |
const value = Number(rawValue); | |
switch (direction) { | |
case 'up': | |
acc.aim -= value; | |
break; |
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
const data = require('./data.json'); | |
const sumArray = (array) => array.reduce((a, b) => a + b, 0); | |
const results = data.data.reduce((acc, n, idx, arr) => { | |
const lenIn = arr.length; | |
const isPastTupleTime = lenIn - idx <= 2; | |
const newAcc = { | |
...acc, | |
lastValue: n, |
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
using System; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class Clock : MonoBehaviour { | |
const float | |
degreesPerHour = 30f, | |
degreesPerMinute = 6f, | |
degreesPerSecond = 6f; |
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
"ETH", "ADA", "BTC", "BCH" |
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
javascript:( | |
(function(){ | |
var project = document.querySelector('[itemprop=name]').textContent.trim().toUpperCase(); | |
var title = document.querySelector('.js-issue-title').textContent.trim(); | |
var comments = document.querySelector('.timeline-comment-wrapper').querySelector('.comment-body').textContent.trim().split('\n').join('%0D%0A'); | |
var url = window.location.href; | |
var subject = `Alpha approval request for: ${project} ${title}`; | |
var body = `Requesting Alpha deploy approval for ${project}: ${title}%0D%0A%0D%0AChangelog:%0D%0A${comments}%0D%0A%0D%0AView more here: ${url}`; |
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
# | |
# Reid Blomquist's zshrc | |
# | |
# stuff being used: | |
# - zsh | |
# - prezto | |
# - powerlevel9k | |
# - a bunch of other shit | |
# |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Wat</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<style> | |
ul, | |
li { |
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
require "json" | |
require "yaml" | |
require "net/http" | |
require "uri" | |
yaml_file = "#{Dir.pwd}/range.yml" | |
uri = URI.parse("https://ip-ranges.amazonaws.com/ip-ranges.json") | |
http = Net::HTTP.new(uri.host, uri.port) |
NewerOlder