Skip to content

Instantly share code, notes, and snippets.

View jamesallardice's full-sized avatar

James Allardice jamesallardice

View GitHub Profile
// Github recognises this as Erlang
let x = 1;
export default class Demo {
constructor( ...args ) {
this.arr = [ ...args ];
}
}

Given an ES6 file, demo.es6 that contains template strings:

let x = 'x';
console.log(`x is ${ x }`);

The following code within a generator method throws a reference error (x is not defined):

Keybase proof

I hereby claim:

  • I am jamesallardice on github.
  • I am jallardice (https://keybase.io/jallardice) on keybase.
  • I have a public key whose fingerprint is 05B9 F06E 6E8D F159 96BD B2B0 6CAE E07B CA24 4767

To claim this, I am signing this object:

@jamesallardice
jamesallardice / account.html
Last active August 29, 2015 14:07
An example of mmRoute configuration
<a ng-href="{{ routes.get('account') }}">Your account</a>
<h2>Your friends</h2>
<ul>
<li ng-repeat="friend in friends">
<a ng-href="{{ routes.get('user', { id: friend.id }) }}">{{ friend.name }}</a>
</li>
</ul>
@jamesallardice
jamesallardice / account.html
Last active August 29, 2015 14:07
An example for ngRoute configuration
<a href="/account">Your account</a>
<h2>Your friends</h2>
<ul>
<li ng-repeat="friend in friends">
<a ng-href="/users/{{ friend.id }}">{{ friend.name }}</a>
</li>
</ul>
@jamesallardice
jamesallardice / app.html
Created July 11, 2013 08:42
AngularJS Emoji filter example
<!doctype>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="emoji.min.css">
<script src="angular.min.js"></script>
<script src="emoji.min.js"></script>
</head>
<body ng-app ng-controller="AppCtrl">
<textarea ng-model="message"></textarea>
@jamesallardice
jamesallardice / gist:5846008
Created June 23, 2013 18:35
A set of bookmarklets to deal with annoying "+1" GitHub issue comments
// Just hide them all
$(".comment-body").each(function (e) {
if($(this).text().trim() === "+1") {
$(this).closest(".discussion-bubble").hide();
}
});
// Hide them all and show a count of them next to the "participants" list
$(".pull-participation").append("<p class='quickstat' style='float:right'><b>" + $(".comment-body").filter(function (e) {
return $(this).text().trim() === "+1";
@jamesallardice
jamesallardice / non-live.html
Last active September 13, 2017 13:28
A simple example to enable Placeholders.js with non-live settings
<!doctype html>
<html data-placeholder-live="false">
<head>
<meta charset="utf-8">
<title>Placeholders.js Default Config</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
</head>
<body class="placeholder-example">
<input type="text" placeholder="I have a placeholder!"><br>
<input type="password" placeholder="Password placeholders!"><br>
@jamesallardice
jamesallardice / hide-on-input.html
Last active December 15, 2015 07:09
A simple example to enable Placeholders.js with hide-on-input settings (rather than hide-on-focus)
<!doctype html>
<html data-placeholder-focus="false">
<head>
<meta charset="utf-8">
<title>Placeholders.js Default Config</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
</head>
<body class="placeholder-example">
<input type="text" placeholder="I have a placeholder!"><br>
<input type="password" placeholder="Password placeholders!"><br>