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 vow = require('vow'), | |
request = require('request'), | |
handler = 'http://api.geonames.org/postalCodeLookupJSON?postalcode=6600&country=AT&username=demo'; | |
function getData(remote) { | |
if(remote) { | |
var promise = new vow.promise(); | |
request(remote, function(err, req, body) { |
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 scrollIntoView(elem) { | |
var elemTop = elem.offset().top, | |
elemBottom = elemTop + elem.height(), | |
viewHeight = window.innerHeight, | |
limitTop = window.scrollY, | |
limitBottom = limitTop + viewHeight, | |
offset = 10; | |
if (elemTop < limitTop) { | |
window.scrollTo(0, elemTop - offset); |
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 backgroundColor = '#262626'; | |
var activeColor = 'darkcyan'; | |
var highlightColor = '#152929'; | |
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 12, | |
// font family with optional fallbacks | |
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', |
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
.List { | |
height: 100%; | |
overflow-y: auto; | |
-webkit-overflow-scrolling: touch; | |
} | |
.List__inner { | |
margin: 0; | |
padding: 0; | |
list-style: none; |
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
Show hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"auto_indent": true, | |
"bold_folder_labels": true, | |
"close_sidebar_if_opened": false, | |
"color_scheme": "Packages/User/SublimeLinter/Juicy (SL).tmTheme", | |
"enable_tab_scrolling": false, | |
"ensure_newline_at_eof_on_save": true, | |
"font_face": "Menlo", | |
"font_options": |
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
#!/usr/bin/env bash | |
set -e | |
NM_BIN=./node_modules/.bin | |
echo "Linting changed files" | |
SRC_FILES=$(git diff --staged --diff-filter=ACMTUXB --name-only -- '*.js' | grep -v '\.test\|mock\|e2e\.js$') && x=1 | |
function lint() { | |
if [ "$2" ]; then |
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
const DIRECTION_DOWN = -1; | |
const DIRECTION_NONE = 0; | |
const DIRECTION_UP = 1; | |
function HardwareElevator() {} | |
HardwareElevator.prototype = { | |
moveUp: function() { console.log("up") }, | |
moveDown: function() { console.log("down") }, |
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 | |
gpg --version # Check GPG installation | |
git --version # Check Git installation | |
git-secret --version # Check git-secret installation | |
gpg --list-keys # Make sure that your GPG key is listed here | |
git init # Initialize the repository if you have not done it already | |
git secret init # Initialize the repository using git-secret | |
git secret tell email@example.com # Add a user |
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
const METRICS_BY_AXIS = { | |
horizontal: { | |
size: 'clientWidth', | |
scroll: 'scrollWidth' | |
}, | |
vertical: { | |
size: 'clientHeigh', | |
scroll: 'scrollHeigh' | |
} | |
}; |
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
// Mask('**.**.****', '17.02'); | |
// Mask('+7 (***) ***-**-**', '9854554354123283293'); | |
// Mask('+7 (***) ***-**-**', '9854554354123283293', { isStrict: true }); | |
export function mask(maskStr, str, { isStrict = false } = {}) { | |
let decorSymbCount = 0; | |
let maskedStr = ''; | |
for (let i = 0; i < maskStr.length && str[i - decorSymbCount]; i++) { | |
const m = maskStr[i]; | |
const v = str[i - decorSymbCount]; |
OlderNewer