Skip to content

Instantly share code, notes, and snippets.

View bsturdivan's full-sized avatar

Brian Sturdivan bsturdivan

View GitHub Profile
function countOccurances(nums, k) {
let frquencyHash = {}
const frequencyArray = Array.from({ length: nums.length + 1 }, () => 0)
nums.forEach(num => {
frquencyHash[num] = (frquencyHash[num] || 0) + 1
})
for (const item in frquencyHash) {
frequencyArray[frquencyHash[item]] = (
const BLOCK_SIZE = 4
const phrases = [
"Happy Birthday Lauren Conrad",
"Night Shade / Moon Beam",
"Escapement",
"Light / Leicht",
"Cap 3",
"Grapehene",
"Undercurrent / Watershed",
"Webtape",
const BLOCK_SIZE = 4
const phrases = [
"Happy Birthday Lauren Conrad",
"Night Shade / Moon Beam",
"Escapement",
"Light / Leicht",
"Cap 3",
"Grapehene",
"Undercurrent / Watershed",
"Webtape",
function parseObject(template, data) {
return new Function('obj', `return obj.${template}`)(data)
}
function htmlStringParse(match, data) {
return Function(
'parseObject',
'data',
'template',
`return parseObject(template, data)`
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import { BuilderBlock } from '@builder.io/react'
import SlickCarousel from 'base/lib/ui/slick_carousel'
@BuilderBlock({
name: 'Slider',
inputs: [
{
name: 'autoplay',
# Original
@responseHours =
if E.lib.helpers.inRange day, 1, 5
if E.lib.helpers.inRange(hour, 17, 22)
'3 hr'
else if E.lib.helpers.inRange hour, 5, 16
'40 min'
else
'6 hr'
else if holiday
- fulfilling expectations
- Met in middle school
- Became friends in high school when we learned we both like emo music and post rock and had the same weird friends
- We in a band (Hello Destiny in high school, April now)
- backgrounds
(Jeff)
(Brian)
- grew up an artist
- music major -> graphic design -> “web” degree
- What does Jeff actually do
@bsturdivan
bsturdivan / Brian's Song
Last active August 29, 2015 14:02
The (real) most pleasing musical interval
e|---0----0----0----0----0-2---0----0----0--|
B|--0-2--0-3--0-2--0----0-----0-3--0-2--0---|
G|-0----0----0----0--2-0-----0----0----0--2-|
(G-B-E) C# (G-B-E) D (G-B-E) C# (G-B-E) A (G-B-E) F# (G-B-E) D (G-B-E) C# (G-B-E) A
To make this easier to play, here is the song transposed to the key of C
Unfortunately this song jumps between two keys, so to transpose perfectly to the key of C
I had to change one note.
@bsturdivan
bsturdivan / gist:6325593
Last active December 21, 2015 15:19
Promises.js
var Promise = function() {
var response = null,
successCallback = null;
return {
resolve: function(value) {
response = value;
if(successCallback) {
$.extend(MyClass.prototype, {method: function() {
var i = 0,
stacey = hair,
crazy = hair.length;
for(;1<=crazy;1++) {
console.log("Let's face it, this is an infinite loop");
}
}});