Skip to content

Instantly share code, notes, and snippets.

@gmilby
gmilby / app.html
Created November 6, 2013 20:28
angular ajax request with $http
<h1>{{model.message}}</h1>
# Personality & Interest
* Describe how you collaborate with designers, other developers, and managers on a project.
* What was the last design/development book you read, and what did you think about it?
* Which development frameworks have you explored, and what did you think about them?
* Tell me about a site where you witnessed a standout example of good/bad user experience. What would you have done differently?
* What are some of the design/development blogs you read on a regular basis? What do you like about them?
* Describe your ideal colleagues and managers.
# Technical Skills
anglar.module('myApp',['ui']).config(["$provide", function($provide) {
return $provide.decorator("$http", ["$delegate", function($delegate) {
var get = $delegate.get;
$delegate.get = function(url, config) {
// Check is to avoid breaking AngularUI ui-bootstrap-tpls.js: "template/accordion/accordion-group.html"
if (url.indexOf('template/')) {
// Append ?v=[cacheBustVersion] to url
url += (url.indexOf("?") === -1 ? "?" : "&");
url += "v=" + cacheBustVersion;
}
@gmilby
gmilby / app.js
Created October 29, 2013 21:45 — forked from eperedo/app.js
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope, $timeout) {
$scope.save = function(){
$scope.loading = true;
$timeout(function(){
$scope.loading = false;
}, 3000);
};
@gmilby
gmilby / recursivescan.php
Created October 23, 2013 20:46
recursivescan.php
<?php
$directory = "/home/gmilby/dev-15";
class recursive_scan{
private $directory;
private $current_location = array();
/**
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ladda Examples - different size buttons</title>
<link rel="stylesheet" href="dist/ladda.min.css">
<!-- demo stylesheet for this page only -->
<link rel="stylesheet" href="css/demo.css">
</head>
<body>
start on runlevel [2345]
stop on runlevel [06]
exec /path/to/start.sh
@gmilby
gmilby / crSpline.js
Created October 2, 2013 14:08
crSpline.js makes debug points in js
// Generate a random example spline and fancy visualization to help see what the plugin is doing
DEMO = {
showWaypoints: true,
showTrail: false
};
DEMO.run = function() {
var minX = 200;
var minY = 200;
@gmilby
gmilby / phpAsScript.php
Created September 30, 2013 19:37
replacing perl scripts
#!/sw/php/bin/php
<?php
$file = __FILE__;
$filename = basename($file);
$instances = `ps -Af | grep 'php .*$filename' | grep -v 'grep' | wc -l`;
$instances = intval(trim($instances));
if($instances > 1)
{
print "$filename is already running! ($instances)\n##ScriptDashStatus=-2\n";
@gmilby
gmilby / unixTime.html
Created September 26, 2013 13:32
convert unix time to human readable or vice versa
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="DESCRIPTION" content="Convert Unix time to a readable date">
<meta name="KEYWORDS" content="unix, UT, GMT, seconds, epoch, milliseconds">
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function timeToHuman() {
var theDate = new Date(document.u2h.timeStamp.value * 1000);