Skip to content

Instantly share code, notes, and snippets.

@gmilby
gmilby / createUUID.js
Created September 18, 2013 16:46
angular - create unique id
angular
.module('uuidApp', ['lvl.services'])
.controller('uuidCtl', ['$scope', 'uuid', function($scope, uuid){
$scope.generateUuid = function() {
$scope.new = uuid.new();
$scope.nInfo = new Date();
};
$scope.showEmpty = function() {
$scope.empty = uuid.empty();
<html>
<head>
<title>Unpinned Merchants</title>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript' src='zingchart/resources/jquery.min.js'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['table']});
google.setOnLoadCallback(reload_executions);
// set up the fixed locations and paths for this metric visualization.
// we need to be able to pick the server (prod, uat, dev).
class A {
public $foo = 'foo';
private $bar = 'bar';
public function getClosure() {
return function ($prop) {
return $this->$prop;
};
}
}
<?php
class A {
private $value = 1;
public function getClosure()
{
return function() { return $this->value; };
}
}
$a = new A;
@gmilby
gmilby / multiselect-ui_untested_example.js
Created September 5, 2013 20:16
multiselect (e . hynds) options
(function($) {
setTimeout( function() {
var report_thinking = SPECTRUM.find( "a:contains('Allocation Report')" );
// $( report_thinking ).css( 'color', 'red'); // it works - the menu/nav link is avilable before this is loaded.
console.log(report_thinking);
SPECTRUM.on( 'click', report_thinking, function() {
blockUI(true);
console.log(report_thinking.text());
});
define = ((root) ->
if typeof root.define isnt 'function' or not root.define.amd
if GLOBAL? and typeof module is 'object' and module.exports
(factory) ->
module.exports = factory(GLOBAL.require)
else
require = (dep) ->
(() =>
switch dep
when 'underscore' then @_

Star Wars opening crawl from 1977

I freaking love Star Wars, but could not find a web version of the original opening crawl from 1977. So I created this one.

I wrote an article where I explain how this works. Watch the Start Wars opening crawl on YouTube.

Stuff I used:

  • CSS (animation, transform)
  • HTML audio (the opening theme)
@gmilby
gmilby / Any-Image-To-CSS.markdown
Created August 29, 2013 12:57
A Pen by Emad Elsaid.

Any Image To CSS

using this small script you can choose any image from you computer, i prefere to be small size image, and convert it into CSS multiple shadow div style.

i added the base64 encoded image of anger bird as demonstration only, you can remove it if you wish.

A Pen by Emad Elsaid on CodePen.

License.

$getTime = date("Y-m-d H:i:s",(time()-(86400*$thisHowLong)));