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
https://github.com/Doist/backend-issues/issues/2284 | |
https://github.com/Doist/backend-issues/issues/2566 | |
https://github.com/Doist/backend-issues/issues/2290 | |
https://github.com/Doist/backend-issues/issues/2303 | |
https://github.com/Doist/backend-issues/issues/2026 | |
https://github.com/Doist/backend-issues/issues/2282 | |
https://github.com/Doist/backend-issues/issues/2388 | |
https://github.com/Doist/backend-issues/issues/2555 |
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
// USAGE: | |
// node delay_ass.js subtitle.ass -32 | |
const fs = require('fs'); | |
const fileName = process.argv[2]; | |
const delaySeconds = process.argv[3]; | |
const encoding = process.argv[4] || 'utf16le'; | |
if (typeof delaySeconds === 'undefined') { | |
console.log( |
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
require 'FileUtils' | |
root = ARGV[0] || "/Volumes/Kindle/documents" | |
all_files = Dir[root + "/*"] | |
rec_files = all_files.find_all{ |f| f.end_with?(".sdr") } | |
# doc_types = ['txt', 'pdf', 'mobi', 'azw'] | |
doc_files = all_files.find_all do |f| | |
f.end_with?("mobi") || | |
f.end_with?("pdf") || |
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
[ | |
{"name": "Afghanistan", "code": "AF"}, | |
{"name": "Åland Islands", "code": "AX"}, | |
{"name": "Albania", "code": "AL"}, | |
{"name": "Algeria", "code": "DZ"}, | |
{"name": "American Samoa", "code": "AS"}, | |
{"name": "AndorrA", "code": "AD"}, | |
{"name": "Angola", "code": "AO"}, | |
{"name": "Anguilla", "code": "AI"}, | |
{"name": "Antarctica", "code": "AQ"}, |
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
app.controller 'AppCtrl', ($rootScope) -> | |
# broadcast click event within AppCtrl | |
$(document).on 'click', (e) -> | |
$rootScope.$broadcast 'click', e.target | |
# this target is a js dom element |
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
app.directive 'checkbox', (Page) -> | |
# Page should be refreshed upon entering the page, within page controller | |
restrict: 'E' | |
scope: | |
hook: '@' | |
hookedTo: '@' | |
checkedStoredIn: '=' | |
templateUrl: 'checkbox.html' | |
link: (scope, element, attr) -> | |
hookName = scope.hook || scope.hookedTo |
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
# to provide a fallback for the new CSS property, position: sticky; | |
# which let an element stays where it is when it's within the screen | |
# and when it's disappearing into the top of the page with scrolling, | |
# change the position's behavior to fix. | |
app.directive 'sticky', ($window, WindowObj) -> | |
restrict: 'A' | |
link: (scope, element, attr) -> | |
sticky = undefined | |
originalOffsetY = element[0].offsetTop |
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
app.directive 'scroll', ($window) -> | |
restrict: 'A' | |
($scope, $element, $attr) -> | |
win = angular.element($window) | |
$scope.$watch -> | |
scrollX: window.scrollX | |
scrollY: window.scrollY | |
, (newVal, oldVal) -> | |
$scope.scrollX = newVal.scrollY |
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
# dependency: jQuery | |
app.directive 'resize', ($window) -> | |
restrict: 'A' | |
($scope, $element, $attr) -> | |
win = angular.element($window) | |
$scope.$watch -> | |
w: win.width() | |
h: win.height() | |
, (newVal, oldVal) -> |
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
# use: fix the bug when angular-ui-bootstrap slider flickers | |
app.directive 'disableNgAnimate', ($animate) -> | |
restrict: 'A' | |
link: ($scope, $element) -> $animate.enabled(false, $element) |
NewerOlder