Skip to content

Instantly share code, notes, and snippets.

View ryan-scott-dev's full-sized avatar

Ryan Scott ryan-scott-dev

View GitHub Profile
@ryan-scott-dev
ryan-scott-dev / generate_project_name.sh
Created February 2, 2016 05:18
Random Project Name Generator
for i in {1..10}; do curl -L http://starwars.wikia.com/wiki/Special:Random 2>&1 | sed -n 's/<title>\(.*\) - Wookieepedia - Wikia<\/title>/\1/p'; done
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
};
Function.method('mixin', function (properties) {
Object.keys(properties).forEach(function(property) {
if (!this.prototype.hasOwnProperty(property)) {
this.prototype[property] = properties[property];
}
{
init: function(elevators, floors) {
// Find the closest elevator which isn't full
var findSuitableElevator = function(floor) {
var floorNum = floor.floorNum();
var idealElevator =
_.chain(elevators)
.filter(function(elevator) {
return elevator.loadFactor() < 0.7;
@ryan-scott-dev
ryan-scott-dev / gist:d5e2cf98ce3c5afda34f
Created December 1, 2014 22:57
Facebook open tags test
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie9" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" itemscope itemtype="http://schema.org/Product"> <!--<![endif]-->
<head>
<meta charset="utf-8">
@ryan-scott-dev
ryan-scott-dev / gist:2490ac13e7afa3384548
Last active August 29, 2015 14:07
Ruby related Regex's
# Find all strings using " unnecessarily
"([^#"'\n;]+)"
# Replace with '
'\1'
<!DOCTYPE html>
<html>
<head>
<title>This file will try and create a conversation through a CSRF exploit using the session!</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<h1>This file will try and create a node in the cloud using a CSRF exploit using the session!</h1>
// A plugin to add Ajax communication with a RESTful JSON API.
//
// Depends on JSON.stringify() and jQuery's $.ajax()
//
// Expects models to have toJSON and fromJSON methods.
// ============================================================================
// Define the maria.Repository class. The base class for Ajax/JSON Repositories.
// =============================================
// Custom Settings
// Last Updated:2013-10-3
// =============================================
// =============================================
// File Paths
// =============================================
@import 'groundwork_settings';
@import 'groundworkcss/groundwork';
// =============================================
// Web Fonts
// Last Updated:2013-8-16
// =============================================
@for $i from 1 through length($web-font-files) {
@font-face {
@ryan-scott-dev
ryan-scott-dev / NavigationModel.js
Created March 25, 2014 03:15
Maria Routing Example
application.Model.subclass(application, 'NavigationModel', {
constructor: function(appModel) {
this._appModel = appModel;
},
attributes: {
_appModel: null,
_lastTarget: 'home',
_lastHashPath: null
},
properties: {