Skip to content

Instantly share code, notes, and snippets.

View ryan-w-moore's full-sized avatar

Ryan W Moore ryan-w-moore

View GitHub Profile
@ryan-w-moore
ryan-w-moore / Penrose-Triangle.markdown
Created June 2, 2014 23:38
A Pen by Ryan W Moore.
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
@ryan-w-moore
ryan-w-moore / Comparison
Created November 11, 2014 09:09
Operators
// I. Comparison Operators:
if ( a == b ) {... // == Equality
if ( a != b ) {... // != Not Equal to
if ( a === b ) {... // === Strictly Equal to
if ( a !== b ) {... // !== Not Strictly Equal to
if ( a > b ) {... // > Greater Than
if ( a < b ) {... // < Less Than
if ( a >= b ) {... // >= Greater Than, or Equal to
if ( a <= b ) {... // <= Less Than, or Equal to
@ryan-w-moore
ryan-w-moore / Console
Created November 11, 2014 09:46
Syntax, Cont'd...
var foo = 10;
var bar = 20;
if (foo < bar ) {
//console.log("foo is less than bar");
//console.log("and here's a second message");
//console.log("and here's a third message");
//console.log(foo);
//console.log(foo,bar);
//console.debug("foo is less than bar");
@ryan-w-moore
ryan-w-moore / Functions in JavaScript
Created November 11, 2014 10:28
JavaScript Core Syntax, Cont'd...
/*
get window height
get window width
calculate area
store area
do calculation
check value
output message
get image position
calculate new value
var singleValue;
singleValue = 99;
var multipleValues = [];
multipleValues[0] = 50;
multipleValues[1] = 60;
mulitpleValues[2] = "Mouse";
console.log(multipleValues[2]); // Mouse
@ryan-w-moore
ryan-w-moore / Objects
Created November 11, 2014 12:20
Objects
// OBJECTS IN JAVASCRIPT:
// An Object is a container for data and behavior
// A name for variables and functions:
// THUSLY:
var playerName = "Fred";
var playerScore = 10000;
var playerRank = 1;
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@ryan-w-moore
ryan-w-moore / templated.php
Created November 13, 2015 02:12 — forked from sicksand/templated.php
Stumble this upon site ( http://templated.co ) that offer over 800+ HTML5 + CSS + Responsive. This php script will download the file automatically. For now, the page is now 20.
<?php
/*
Name - templated.php
Author - Shafiq Mustapa ([email protected])
Usage - php templated.php
Stumble this upon site (http://templated.co)that offer over 800+ HTML5 + CSS + Responsive.
This php script will download the file automatically. For now, the page is now 7.
Tools
@ryan-w-moore
ryan-w-moore / SassMeister-input.sass
Created February 23, 2016 18:39
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// Bourbon (v4.2.6)
// ----
@import "bourbon/bourbon"
$color-yellow: #fffe99
$color-green: #b6feb7