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
.directive('headerShrink', function($document) { | |
return { | |
restrict: 'A', | |
link: function($scope, $element, $attr) { | |
var y = 0, | |
prevY = 0, | |
scrollDelay = 0.4, | |
scrollTop, | |
fadeAmt; |
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
var this.options = { | |
count: 3, | |
from: -60, | |
to: 60 | |
}; | |
var from = Math.max(-90, Math.min(90, +this.options.from)); | |
var to = Math.max(-90, Math.min(90, +this.options.to)); | |
var rotateScale = d3.scale.linear().domain([0, this.options.count - 1]).range([from, to]); |
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
// http://www.geonames.org/BD/largest-cities-in-bangladesh.html | |
var cities = []; [].forEach.call(document.querySelectorAll('table.restable a:not([rel=nofollow])'), function(el){console.log(el.innerText); if (el.innerText) cities.push(el.innerText)}); console.log(cities.join(',')) |
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
du -hs * |
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
var js = [variables.bower + 'd3/d3.js', | |
variables.bower + 'd3-tip/index.js', | |
variables.bower + 'd3-cloud/d3.layout.cloud.js', | |
variables.bower + 'c3/c3.js', | |
variables.bower + 'topojson/topojson.js', | |
variables.bower + 'datamaps/dist/datamaps.all.js', | |
variables.bower + 'moment/moment.js', | |
variables.bower + 'moment/locale/en-gb.js', | |
variables.bower + 'moment/locale/fr.js', | |
variables.bower + 'moment/locale/es.js', |
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
var gulp = require('gulp'), | |
runSequence = require('run-sequence'), | |
gulpif = require('gulp-if'), | |
argv = require('minimist')(process.argv.slice(2)), | |
uglify = require('gulp-uglify'), | |
clean = require('gulp-clean'), | |
minifyCss = require("gulp-minify-css"), | |
minifyHtml = require("gulp-minify-html"), | |
header = require("gulp-header"), | |
stripDebug = require('gulp-strip-debug'), |
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
// JS | |
$rootScope.$on('$stateChangeSuccess', (event, toState, toParams, fromState, fromParams) => { | |
// Add a timeout for ionic transitions | |
// For 500ms we will have both module classes | |
// so both modules will have the right css | |
// when transitionned we remove the previous module class | |
clearTimeout(stateChangeTimeout); | |
stateChangeTimeout = setTimeout(() => { | |
$document.find('html').removeClass(`${_.kebabCase(fromState.class || fromState.name)}`); | |
}, 500); |
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
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Downloads/test.png |
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'; | |
import {Link as ReactLink} from 'react-router'; | |
export default class Link extends React.Component { | |
parseTo(to) { | |
let parser = document.createElement('a'); | |
parser.href = to; | |
return parser; | |
} | |
isInternal(toLocation) { |
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'; | |
import {Link as ReactLink} from 'react-router'; | |
export default class Link extends React.Component { | |
parseTo(to) { | |
let parser = document.createElement('a'); | |
parser.href = to; | |
return parser; | |
} | |
isInternal(toLocation) { |
OlderNewer