Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

♥♥♥♥♥ ����� MACSkeptic

🏠
Working from home
View GitHub Profile
@MACSkeptic
MACSkeptic / README.md
Created Jul 15, 2021 — forked from chrisrzhou/README.md
D3 Radar Chart
View README.md

D3 Radar Chart

bl.ocks.org link

A radar chart visualizes multivariate data in a 2D chart of three or more quantitative variables represented on axes.

The project is created using AngularJS and D3.js.


Description

View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View gist:db5f675a1221752370f565ecf8263140
alias.sup=for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
alias.co=checkout
alias.lol=log --oneline --decorate
alias.rhh=!git reset HEAD^ && git reset
alias.st=status -s
alias.rr=!git reset HEAD^ && git reset
alias.dc=diff --cached -w
alias.rc=rebase --continue
alias.aa=add -A .
alias.prom=pull --rebase origin master
View issue.md

UI Tests == DRAFT (2017-05-29) ==

Changelog

Definition (disambiguation)

  • UI Tests use a real browser to perform actions as close as possible to how real users would perform them.
@MACSkeptic
MACSkeptic / code.js
Created Feb 21, 2017
pricingplansinversion
View code.js
const pricingPlansGroupedByServiceLevel =
_.groupBy(_.get(pricingPlans, ['data', 'pricingPlans']) || [], 'id');
// temporary
const flatHack = _.reduce(pricingPlansGroupedByServiceLevel, (finalResult, pricingPlans, serviceLevelId) => {
return _.merge(finalResult, {
[serviceLevelId]: _.flatMapDeep(pricingPlans, pricingPlan => {
return _.flatMapDeep(pricingPlan.commitDiscounts, (commitDiscounts, paymentType) => {
return _.flatMapDeep(commitDiscounts, commitDiscount => {
return _.flatMapDeep(commitDiscount.discounts, discount => {
View chrome_speech_recognition.js
rec = new webkitSpeechRecognition;
rec.continuous = true;
rec.interimResults = true;
rec.onresult = function (ev) {
console.log(ev.results[ev.results.length-1][0].transcript);
};
rec.start()
View strictly-this.js
(function () {
"use strict";
function x() { console.log(this); }
x();
}())
// -> undefined
(function () {
function x() { console.log(this); }
x();
@MACSkeptic
MACSkeptic / good-morning.js
Created Jul 29, 2013
callback is invoked only for indexes of the array which have assigned values (from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)
View good-morning.js
[1, 2].map(function (x) { return x; }) // -> [1, 2]
[1,, 2].map(function (x) { return x; }) // -> [1, undefined × 1, 2]
[1, 2].map(function () { return 'constant'; }) // -> ["constant", "constant"]
[1,, 2].map(function () { return 'constant'; }) // -> ["constant", undefined × 1, "constant"]
View file.js
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, data = require('./routes/data')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
View gist:4498671
function authWithCas(req, res) {
var CAS = require('cas');
var cas = new CAS({base_url: 'https://cas.thoughtworks.com/cas', service: 'www.recruiting-dashboard.herokuapp.com'});
var ticket = req.param('ticket');
if (ticket) {
cas.validate(ticket, function(err, status, username) {
if (err) {
// Handle the error