Skip to content

Instantly share code, notes, and snippets.

View wfendler's full-sized avatar

William Fendler wfendler

View GitHub Profile
install.packages("base64enc")
library(base64enc)
secret <- list(
list(pos = 16, val = "eW91"),
list(pos = 22, val = "TmV2ZXI="),
list(pos = 1, val = "Z29ubmE="),
list(pos = 6, val = "Z29ubmE="),
list(pos = 18, val = "Z29ubmE="),
list(pos = 23, val = "Z29ubmE="),
var geoJson = [{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-75.00, 40]
},
"properties": {
"location": "Minneapolis, MN",
"address": "5500 Wayzata Boulevard <br>Suite 800<br>Minneapolis, MN 55416<br>United States",
"phone1": "Main: +1 (763) 545-1730",
@wfendler
wfendler / featured-article.html
Last active December 25, 2015 00:59
Featured article modules re-using abstractions and creating generic class names.
<!-- Current Markup -->
<div class="category-and-time">
<p class="feature-category">Food &amp; Beverage</p>
<p class="feature-time">2 hours ago</p>
</div>
<!--
Re-using current abstractions and more generic naming convention:
Also, I'd argue a list is more-semantic than two paragraph tags in this situation.
.btn {
font-family: cujojp;
color: brightPink;
}
.btn--primary {
font-size: 2em;
}
.btn--forward {
// FILE: _mq-mixin-modern.scss
//
// standard media-query mixin with set breakpoints and the option for px-based min-width value
@mixin media-query($media-query){
@if $media-query == "hand-and-up" {
@media only screen and (min-width: $hand-start) { @content; }
}
@else if $media-query == "lap-and-up" {
@media only screen and (min-width: $lap-start) { @content; }
@wfendler
wfendler / gist:5978388
Created July 11, 2013 19:18
Building a memory/matching game. I want to start with 6 divs, clone them, and randomize the order. At this point I have an array with 12 items. Is this correct so far? I've found some functions to randomize the order of an array. That shouldn't be a problem. Once I have that, is it fastest to do a for loop and .append() to the page? Or should I …
this.$initialCardCollection.length = $('.js-memory-card');
this.fullCardCollection = [];
// this.$initialCardCollection.length has the original divs on the page that i'll clone.
for ( var i = 0; i < this.$initialCardCollection.length; i++ ) {
var $thisCard = $(this.$initialCardCollection[i]);
this.fullCardCollection.push( $thisCard );
this.fullCardCollection.push( $thisCard.clone() );
}
<div data-picture data-alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
<div data-src="small.jpg"></div>
<div data-src="small.jpg" data-media="(min-device-pixel-ratio: 2.0)"></div>
<div data-src="medium.jpg" data-media="(min-width: 400px)"></div>
<div data-src="medium_x2.jpg" data-media="(min-width: 400px) and (min-device-pixel-ratio: 2.0)"></div>
<div data-src="large.jpg" data-media="(min-width: 800px)"></div>
<div data-src="large_x2.jpg" data-media="(min-width: 800px) and (min-device-pixel-ratio: 2.0)"></div>
<div data-src="extralarge.jpg" data-media="(min-width: 1000px)"></div>
<div data-src="extralarge_x2.jpg" data-media="(min-width: 1000px) and (min-device-pixel-ratio: 2.0)"></div>
@wfendler
wfendler / gist:5498975
Last active December 16, 2015 21:20
Contextual Nesting vs. OOCSS
/*------------------------------------*\
3M Homepage Feed Nav Bar Styles
\*------------------------------------*/
.feed {
.nav {
.h4 {
}
ul {
li {
a {
class TrackAnalytics
constructor: (@el) ->
@bindEvents()
bindEvents: ->
@el.on 'click', (e) =>
e.preventDefault()
@setEventProps()
class TrackAnalytics
constructor: (@el) ->
@bindEvents()
bindEvents: ->
$('body').on 'click', '.track', (e) =>
e.preventDefault()
@setEventProps()