This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
let lastScrollY = 0; | |
let ticking = false; | |
class App extends React.Component { | |
componentDidMount() { | |
window.addEventListener('scroll', this.handleScroll, true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sorts an array and allows multiple sorting criteria. | |
* | |
* It applies the Schwartzian transform: | |
* https://en.wikipedia.org/wiki/Schwartzian_transform | |
* | |
* Author: David Rivera | |
* Github: https://github.com/jherax | |
* | |
* You can fork this project on github: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(root, _, undefined) { | |
var Disposable = root.Disposable = function() { | |
this.disposed = false; | |
}; | |
Disposable.prototype = { | |
_dispose: function() { | |
if (!this.disposed) { | |
this.dispose(); | |
this.disposed = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* range() | |
* | |
* Returns an array of numbers between a start number and an end number incremented | |
* sequentially by a fixed number(step), beginning with either the start number or | |
* the end number depending on which is greater. | |
* | |
* @param {number} start (Required: The start number.) | |
* @param {number} end (Required: The end number. If end is less than start, | |
* then the range begins with end instead of start and decrements instead of increment.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author | |
* David Rivera (jherax) | |
* https://github.com/jherax | |
*/ | |
/* eslint-disable no-bitwise */ | |
/** @private */ | |
const toString = Object.prototype.toString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @private | |
var isObject = (value) => | |
value != null && typeof value === 'object'; | |
/** | |
* @private | |
* Restores the one-level-depth object to the original nested object. | |
* | |
* @param {Array} names: list of keys in the object | |
* @param {any} value: the value of the object to transform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To create in [.babun/]cygwin/usr/local/bin/subl with chmod +x | |
ARGS="" | |
while test $# -gt 0 | |
do | |
ARGS="$ARGS ${1#/cygdrive/[a-zA-Z]}"; # Remove /cygdrive and disk letter from the path | |
shift | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html ng-app="Demo"> | |
<head> | |
<meta charset="utf-8" /> | |
<title> | |
Using URL Interpolation With $http In AngularJS | |
</title> | |
</head> |
NewerOlder