Skip to content

Instantly share code, notes, and snippets.

View maddie927's full-sized avatar

maddie maddie927

  • LA
View GitHub Profile
@maddie927
maddie927 / Module.js
Created May 27, 2016 22:52
PureScript: proposed changes to currying
exports.add2Ints = function(a, b) {
return a + b;
};
@maddie927
maddie927 / keybase.md
Created April 19, 2016 02:43
keybase.md

Keybase proof

I hereby claim:

  • I am spicydonuts on github.
  • I am spicydonuts (https://keybase.io/spicydonuts) on keybase.
  • I have a public key whose fingerprint is EDC9 7025 F5A7 4824 09F6 B7A4 E996 4B5E AA32 30BB

To claim this, I am signing this object:

@maddie927
maddie927 / 1.js
Last active November 4, 2016 11:10 — forked from blittle/1.js
Comparison
const Pricing = React.createClass({
// ...
render() {
// ...
return (
<div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}>
{purchaseError ? (
<div className="purchase-complete">
<h2 style={{ color: 'hsl(10, 50%, 50%)' }}>Oops!</h2>
<p>
@maddie927
maddie927 / Main.purs
Last active January 21, 2016 21:46
build error
module Main where
import Prelude (Unit, bind, pure, show, unit, ($), (<$>), (<>))
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE)
import Control.Monad.Eff.Exception (EXCEPTION)
import Data.Either (Either(Left, Right))
import Data.Foreign (F)
import Data.Foreign.Class (class IsForeign, readJSON, readProp)
import Data.String (joinWith, split)
// usage:
openToggler(getElement('#some-element'), getElement('#some-element-dropdown'));
// code:
function openToggler(clicker, target) {
if (!clicker || !target) return;
var setter = classSetter(target, 'open');
var opened = false;
var clickHandler = function (e) {
opened = !opened;
export SSHKEY=[path to ssh key]
export CFDOMAIN=[xyz.com]
mkdir -p logs
rm -f filelist
alias do_ftp='sftp -q -b - -i $SSHKEY -P 2222 $CFDOMAIN\@[email protected]'
echo 'ls -1' | do_ftp | grep '^logs-' | awk '{print "get " $0 " logs/ \nrm " $0}' | do_ftp
@maddie927
maddie927 / fetch-helpers.js
Last active December 23, 2019 19:44
Fetch API Helpers
import fetch from 'isomorphic-fetch'
const setupRequestOptions = (options = {}, overrideMethod) => {
if (overrideMethod) options.method = overrideMethod
if (!options.headers) options.headers = {}
options.credentials = 'same-origin'
return options
}
const setupJsonRequestOptions = (options, overrideMethod) => {

I'm really confused about environment variables right now.

  • If I run PORT=1234 node . it ignores PORT and uses the default.
  • If I then run vim, write one of the js files (with no changes, but I have to write it) and close it and run PORT=1234 node . again, it works and runs on 1234.
  • If I then run PORT=4321 node . it ignores the new PORT and continues to run on 1234.
  • If I repeat the process of opening vim, writing a file, and closing vim and running node again, it uses 4321.
  • I'm seeing this on two different servers and it's affecting other things on process.env, like NODE_ENV and the app's version number which I put there when it first starts
  • I DON'T see this behavior when I just run PORT=xxxx node and then interactively ask it what process.env.PORT is

later... omg, babel was caching the env variables in /tmp/.babel.json and checking out new code wasn't resetting it Babel's driving me crazy right now. 6 has been a huge pain to set up (I haven't gotten it working with this pr

module Main where
import Control.Monad.Eff
import Data.Array (replicate, (!!), updateAt)
import Data.Maybe.Unsafe (fromJust)
import Data.Nullable (toMaybe)
import Prelude
import DOM.HTML (window)
import DOM.HTML.Document (body)
What is it?
  • Compiles to JavaScript
  • Haskell-inspired type system (with some improvements!)
  • No runtime (unlike Elm, GHCJS, etc)
  • A focus on readable and debuggable JavaScript