Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="myApp">
.box {
width: 100px;
height: 100px;
border: 10px solid blue;
margin: 30px;
}
.out {
box-shadow: 10px 0;
}
.box {
width: 100px;
height: 100px;
border: 10px solid blue;
margin: 30px;
}
.out {
box-shadow: 10px 0;
}
{
"data": {
"code": "400.1",
"meta": {
"msg": "multiple points"
}
},
"status": 400,
"config": {
"method": "GET",
@albertywu
albertywu / screeningDetails.html
Created March 6, 2015 22:56
screeningDetails
<h1>Screen Details</h1>
<ul ng-if="smartlist">
<li>
<span>Created By</span>
<span>{{ smartlist.createdBy | userShortName }}, {{ smartlist.createdOn | date: "shortDate" }}</span>
</li>
<li>
@albertywu
albertywu / screeningDetails.coffee
Last active August 29, 2015 14:16
screening details directives
<!-- Does this make sense for our component APIs? -->
<smartlist-details
smartlist-id="smartlistId"
></smartlist-details>
<ipad-subscriptions
smartlist-id="smartlistId"
user-id="userId"
fund-id="fundId"
@albertywu
albertywu / getUniqueClasses
Created May 23, 2015 04:50
Short snippet that returns an array of unique classes in the DOM
/* returns an array of unique classes in the DOM */
var getUniqueClasses = function() {
var elementArray = [].slice.call(document.querySelectorAll('*'));
return _(elementArray)
.pluck('classList')
.map(_.toArray)
.flatten()
.unique()
@albertywu
albertywu / tagShape.md
Last active August 29, 2015 14:26
tag field shape
field =
  dataType: 'reference'
  options: [... tagValueIds ...]
  format_json:
    contexts: [
      {
        name: 'iPadNoteCreationModal'
        tagValueIds: [...]
 },
@albertywu
albertywu / speedTest.coffee
Last active October 13, 2015 18:56
Boolean reduction via _.every, _.reduce, _.forEach, vanilla js
trues = (n) -> [1..n].map Boolean
# array of functions to be speed tested
tests = [
[
(
(bools) -> _.every bools # .097ms
)
trues(1000)
@albertywu
albertywu / hubot.coffee
Created November 3, 2015 03:45
log any chat to redshift?
module.exports = (robot) ->
robot.hear /^(.+)$/i, (res) ->
logToRedshift
message: res.match[1]
user: res.message.user.name.toLowerCase()