Operator Mono w/ Italics on OSX Vim
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
echo "Opening git repo" | |
giturl=$(git config --get remote.origin.url) | |
giturl=$( tr '[A-Z]' '[a-z]' <<< $giturl) | |
if [[ $giturl == *"https"* ]] | |
then | |
echo "Switching repo remote origin url from HTTPS to SSH" | |
echo $giturl | |
giturl=${giturl#https://github.com/} | |
repo=${giturl/\.git} |
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
#blog.oscarmorrison.com | |
#Cat feeder (open and close server) | |
#change the pin, and port here. | |
from flask import Flask, jsonify | |
import RPi.GPIO as IO | |
import time | |
pinOutOne = 4 | |
#set this two whatever your 2nd servo is in | |
pinOutTwo = 5 |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 12, | |
// font family with optional fallbacks |
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
heroku config:set `cat .env` |
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
import { line, curve, curveCatmullRom } from "d3-shape"; | |
import { scaleTime, scaleLinear } from "d3-scale"; | |
import { axisBottom, axisLeft } from 'd3-axis'; | |
import { timeParse, isoFormat } from "d3-time-format"; | |
import { select } from "d3-selection"; | |
import { extent, max, min } from "d3-array"; | |
export default { | |
line: line, | |
scaleTime: scaleTime, |
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 getParamsFromSearchURL = url => url.slice(1).split('&').reduce((params, pairs) => { | |
const [key, value] = pairs.split('='); | |
key && value && (params[key] = getValue(value)); | |
return params; | |
}, {}); | |
// this parses foo=true -> make true a bool, not a string | |
const getValue = value => { | |
value = decodeURIComponent(value); | |
try { |
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
// regex from http://stackoverflow.com/questions/46155/validate-email-address-in-javascript | |
const EMAIL_REGEX = /^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-?\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/; | |
const validateEmail = email => { | |
return email | |
&& email.length < 255 | |
&& EMAIL_REGEX.test(email); | |
}; | |
export default validateEmail; |
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> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.4.2/d3.min.js"></script> | |
<script> | |
var data = [4,8,15,16,23,42]; | |
</script> | |
<style type="text/css"> |
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
let text = "There’s an interesting discussion on Quora about the differences between Golang and Scala. As a former academic with tendencies towards functional programming, I used to be very tempted by Scala.1 It offers all the functional goodness without the exoticism of Haskell, and came with reasonably good tools and frameworks. Like Clojure, it’s a functional language you can actually do some work with. The problem with Scala is, the more advanced you get, the more complicated (unreadable?) your code becomes. I remember that back in grad school the dude who was able to doodle the craziest and mathematically most challenging solution to some problem in Haskell was someone everyone looked up to. But it turns out in the “real world” simplicity always trumps virtuosity and sophistication, which is one of the many reasons I love Golang so much. A language with no “magic,” good concurrency support, great documentation and community that compiles into machine code and runs faster than Python? Yes, please. Read th |
NewerOlder