Creating an android using HTML and CSS
A Pen by John Nieves on CodePen.
Creating an android using HTML and CSS
A Pen by John Nieves on CodePen.
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
<div class="wheel"> | |
<div class="centered"><img src="http://www.warrenphotographic.co.uk/photography/bigs/38733-Ginger-cat-white-background.jpg"></div> | |
<ul class="umbrella"> | |
<li class="color"></li> | |
<li class="color"></li> | |
<li class="color"></li> | |
<li class="color"></li> | |
<li class="color"></li> | |
<li class="color"></li> | |
<li class="color"></li> |
(function() { | |
var score = 0, | |
currentQuestion = 0, | |
questions = [{ | |
question: "Who is the current president of the USA?", | |
choices: ['George Bush', 'Barack Obama', 'John F Kennedy', 'Bill Clinton'], | |
answer: 1 | |
}, { | |
question: "Entomology is the science that studies?", | |
choices: ['Behavior', 'Insects', 'Rocks', 'Animals'], |
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.
I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.
// only works for google search results | |
// preferably setting up results to return 100 at a time. | |
// right now this is set up to scrape ibm'ers | |
// original search string = | |
// site:http://researcher.ibm.com/ intext:watson intext:"computer science" intext:"yorktown" intext:"@us.ibm.com" | |
// grab all results in current page | |
var all_results = document.getElementsByClassName('rc'); | |
var cleaned_results = []; | |
// strip all tags from html result |
Android created using CSS | |
----- | |
A [Pen](http://codepen.io/karn09/pen/JgthF) by [John Nieves](http://codepen.io/karn09) on [CodePen](http://codepen.io/). | |
[License](http://codepen.io/karn09/pen/JgthF/license). |
// LetterCountI, using a sentence as a parameter, function will return the word with the most repeating characters. | |
function LetterCountI(str) { | |
var words = str.toLowerCase().split(' '); // take initial str and split into words | |
var freq = {}; // initialize empty frequency object | |
var maxWord = ''; //. initialize empty string for storing word with most repeating chars | |
var maxCh = 1; | |
// iterate over each word, eventually creating letter frequency hash. | |
words.forEach(function(word) { | |
var chars = word.split(''); // initialize array of characters within each word |
// brute force solution to pairSum, this will check every combination of numbers. | |
function pairSum (arr, total) { | |
var arr2 = arr.slice(); // cache copy of array | |
for (var i = 0; i < arr2.length; i++) { | |
var current = arr2[i]; | |
for (var j = 0; j < arr2.length; j++) { | |
// compare running sum against total, make sure indexes don't overlap | |
if (current + arr2[j] === total && i !== j) { | |
return true; // will stop when first combo is found | |
}; |