Skip to content

Instantly share code, notes, and snippets.

View Whoaa512's full-sized avatar
❤️
Love

C.J. Winslow Whoaa512

❤️
Love
View GitHub Profile
@Whoaa512
Whoaa512 / BST.elm
Created September 23, 2015 19:10
Elm BST challenges
{-----------------------------------------------------------------
A "Tree" represents a binary tree. A "Node" in a binary tree
always has two children. A tree can also be "Empty". Below I have
defined "Tree" and a number of useful functions.
This example also includes some challenge problems :)
-----------------------------------------------------------------}
My thoughts on writing tiny reusable modules that each do just one
thing. These notes were adapted from an email I recently sent.
***
If some component is reusable enough to be a module then the
maintenance gains are really worth the overhead of making a new
project with separate tests and docs. Splitting out a reusable
component might take 5 or 10 minutes to set up all the package
overhead but it's much easier to test and document a piece that is
#!/usr/bin/env bash
# Setup script for hacking chrome devtools
# Source -> https://medium.com/p/8c8896f5cef3
echo "Creating folder and initialize a git repo"
mkdir devtools-frontend && cd devtools-frontend
git init
echo "Adding chromium remote and initialize sparse checkout"
git remote add upstream https://chromium.googlesource.com/chromium/blink
@Whoaa512
Whoaa512 / app.html
Last active August 7, 2017 17:44
Meteor code to user FB.ui & the FB SDK
<body>
{{#constant}}
<div id="fb-root"></div>
{{/constant}}
<div> {{> fb_pic}} {{loginButtons}}</div>
<br />
<div><h2>Click to post to your feed:</h2> {{> feed}} </div>
</body>
@Whoaa512
Whoaa512 / client_main.js
Last active February 6, 2018 04:49
Meteor code to display user's facebook picture
Meteor.startup(function() {
Template.fb_pic.pic = function() {// helper function to display the pic on the page
var userProfile;
userProfile = Meteor.user().profile;
if(userProfile) { // logic to handle logged out state
return userProfile.picture;
}
};
});