Skip to content

Instantly share code, notes, and snippets.

View dgieselaar's full-sized avatar

Dario Gieselaar dgieselaar

View GitHub Profile
var listeners = [],
$window;
beforeEach(function ( ) {
var fn;
if(!$window) {
$window = angular.injector([ 'ng' ]).get('$window');
@dgieselaar
dgieselaar / gist:748595
Created December 20, 2010 16:32
Testing for possible FP 10.1 multiplication bug
// should be: 94.8
// results in 94.80000000000001 in WIN 10,1,53,64 debug
var value:Number = 9.48 * 10;
trace("result: " + value + " (using : " + Capabilities.version + " " + (Capabilities.isDebugger ? "debug" : "release") +")");
let ctrl = this,
followers = resource('/api/user/followers', { scope: $scope });
followers.reduce( ( requestOptions, data ) => data.filter(follower => follower.followed_by_user));
ctrl.getFollowing = ( ) => followers.data();
let ctrl = this,
listResource = resource(( ) => `/api/list/${ctrl.listId()}`, { scope: $scope }),
followedByUserResource = resource( ( ) => `/api/user/following`, { scope: $scope }),
listUsersReducer =
composedReducer(listResource, followedByUserResource, ( ) => ctrl.query)
.reduce(( list, followed, query ) => {
return list.users.filter(
user => user.username.includes(query);
)
#!/bin/sh
changed_files="$(git diff --name-only --cached)"
check_run() {
echo "$changed_files" | grep -q '\.js$' && eval "$1"
}
check_run "npm run-script lint"
{
"errors": [
],
"warnings": [
],
"version": "1.12.2",
"hash": "943a89361ef0d15cc5b6",
"publicPath": "/assets/",
javascript:(function ( ) { var host = 'http://shareit.fm',html = '/bookmarks/#' + encodeURIComponent(window.location.href); window.open(host + html, '_blank');})();
$icons: (
"access-point": F002,
"access-point-network": F003,
"account": F004,
"account-alert": F005,
"account-box": F006,
"account-box-outline": F007,
"account-card-details": F5D2,
"account-check": F008,
"account-circle": F009,
let ctrl = this,
listType = 'following',
listItems,
state;
let fetchData = ( ) => {
state = 'pending';
$http({
url: `/api/user/list/${listType}`
})
@dgieselaar
dgieselaar / gist:8b20e9d593e1806a098b
Last active July 5, 2017 10:39
Code splitting, lazy-loading, import statements, Angular + newNgRouter + ocLazyLoad + webpack
import _ from 'lodash';
import angular from 'angular';
import 'angular-new-router';
import 'oclazyload';
function AppController ( ) {
}
AppController.$routeConfig = [];