Skip to content

Instantly share code, notes, and snippets.

View morgs32's full-sized avatar

Morgan Intrator morgs32

View GitHub Profile
@farnabaz
farnabaz / arrow.fabric.js
Created May 22, 2015 23:29
fabric.js arrow shape
//
// Arrow for fabric.js
//
(function($){
$.Arrow = $.util.createClass($.Line, $.Observable, {
initialize: function(e,t) {
this.callSuper("initialize", e, t)
this.set({type:'arrow'});
},
_render: function(e) {
@bennadel
bennadel / ng-if-false.htm
Created January 12, 2015 13:42
Creating A Pre-Bootstrap Loading Screen In AngularJS
<!-- BEGIN: Pre-Bootstrap Loading Screen. -->
<div ng-if="false">
<p>
This will show until the application is bootstrapped.
Then, the ngIf directive will immediately rip it out of
the page.
</p>
</div>

LESS Coding Guidelines

Medium uses a strict subset of LESS for style generation. This subset includes variables and mixins, but nothing else (no nesting, etc.).

Medium's naming conventions are adapted from the work being done in the SUIT CSS framework. Which is to say, it relies on structured class names and meaningful hyphens (i.e., not using hyphens merely to separate words). This is to help work around the current limits of applying CSS to the DOM (i.e., the lack of style encapsulation) and to better communicate the relationships between classes.

Table of contents

@bevacqua
bevacqua / gulp-npm-publish.js
Created January 18, 2014 16:22
Publish packages to `npm` using Gulp.
var spawn = require('child_process').spawn;
gulp.task('npm', function (done) {
spawn('npm', ['publish'], { stdio: 'inherit' }).on('close', done);
});
@amoilanen
amoilanen / webcrawler.js
Last active March 24, 2022 03:14
Simple PhantomJS-based web crawler library
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
@armhold
armhold / spotlight.js
Created June 11, 2012 15:25
jQuery Spotlight modification: added a hide() hook
/**
* jQuery Spotlight
*
* Project Page: http://dev7studios.com/portfolio/jquery-spotlight/
* Copyright (c) 2009 Gilbert Pellegrom, http://www.gilbertpellegrom.co.uk
* Licensed under the GPL license (http://www.gnu.org/licenses/gpl-3.0.html)
* Version 1.0 (12/06/2009)
*
* modified slightly by George Armhold to add a hide() hook for removing the spotlight programmatically.
*/
@thebinarypenguin
thebinarypenguin / movable-resizable-raphael
Created January 4, 2012 02:43
Movable and re-sizable rectangle using Raphael SVG
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Movable and Re-sizable Raphael JS Shape</title>
</head>
<body>
<div id="paper"></div>
@kaylarose
kaylarose / RaphaelJSShapeDrawingApp.html
Created November 11, 2010 21:07
A Simple Vector Shape Drawing App with RaphaelJS and jQuery
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script src="http://yandex.st/raphael/1.5.2/raphael.min.js"></script>
<script>
/**
* A Simple Vector Shape Drawing App with RaphaelJS and jQuery
* copyright 2010 Kayla Rose Martin - Licensed under the MIT license
* Inspired by http://stackoverflow.com/questions/3582344/draw-a-connection-line-in-raphaeljs
**/