Skip to content

Instantly share code, notes, and snippets.

@dtothefp
dtothefp / phantomcss.js
Created July 22, 2014 14:52
test for phantomcss
/*
Author: David Fox-Powell
Company: Optimizely
Last updated date: 20 July 2014
URL: https://github.com/dtothefp/phantomcss-gitdiff
*/
var fs = require('fs');
var _src = '.'+fs.separator+'screenshots';
var phantomcss = require('./../phantomcss.js');
phantomcss.init();
casper.start();
casper.viewport(1024, 768);
var tests = [
function(casper, phantomcss) {
casper.echo("Suite 1");
casper.start("http://google.com/", function() {
// @rmoff
// May 21, 2014
//
// Visual Regression Testing for OBIEE using PhantomCSS/CasperJS
//
// No kind of error or exception handling, no checks for successful login, etc
// Use at your own risk!
//-----------------------------------------------------------------------------
var phantomcss = require('./phantomcss.js');
@kevinSuttle
kevinSuttle / app.js
Last active February 26, 2024 07:02
Gulp, BrowserSync, Sass, Autoprefixer, Nodemon
var express = require('express');
var app = express();
var router = express.Router();
var hbs = require('hbs');
app.set('view engine', 'html');
app.engine('html', hbs.__express);
app.use(express.json());
app.use(express.urlencoded());
@sanderhahn
sanderhahn / gulpfile.js
Last active September 11, 2019 14:45
Minify and templateCache your Angular Templates using Gulp
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var templates = require('gulp-angular-templatecache');
var minifyHTML = require('gulp-minify-html');
// Minify and templateCache your Angular Templates
// Add a 'templates' module dependency to your app:
// var app = angular.module('appname', [ ... , 'templates']);
@DanWahlin
DanWahlin / animations.css
Created December 22, 2013 01:25
Sample AngularJS animations.
.slide-animation.ng-enter, .slide-animation.ng-leave {
-webkit-transition: 0.5s linear all;
-moz-transition: 0.5s linear all;
-o-transition: 0.5s linear all;
transition: 0.5s linear all;
position:relative;
height: 1000px;
}
.slide-animation.ng-enter {
@willurd
willurd / web-servers.md
Last active July 22, 2024 15:25
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mkhatib
mkhatib / geo.js
Created May 24, 2013 02:55
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@nhoizey
nhoizey / screenshots.js
Created November 12, 2012 17:07
Take screenshots at different viewport sizes using CasperJS
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();