This file contains hidden or 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 setCityByIp() { | |
var arrcity = ['Aktau', 'Aktobe', 'Almaty', 'Astana', 'Atyrau', 'Zhezkazgan', 'Karagandy', 'Kyzylorda', 'Kokshetau', 'Kostanay', 'Pavlodar', 'Petropavl', 'Semey', 'Taldykorgan', 'Taraz', 'Oral', 'Oskemen', 'Shymkent']; | |
$.get("http://ipinfo.io", function(response) { | |
for (var i=0; i < arrcity.length; i++) { | |
if (arrcity[i] == response.city) { | |
console.log('You\'re from ' + response.city + 'KZ'); | |
} else if (response.city == null) { | |
console.log('You\'re not from KZ'); | |
} | |
} |
This file contains hidden or 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
# Lock screen with screensaver | |
alias poka_krasivo="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine" | |
# Lock mac | |
alias poka="/System/Library/CoreServices/Menu\ Extras/user.menu/Contents/Resources/CGSession -suspend" | |
# Start python server for Chrome SaveCSS | |
alias server="python /var/project/server.py" | |
# Fast jump to projects directory | |
alias projects="cd /var/project" | |
# Get current IP | |
alias ip="ifconfig |grep 'inet 10'" |
This file contains hidden or 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 isKazakhstan = function() { | |
$.get("//ipinfo.io", function(response) { | |
if (response.country == 'KZ') console.log('Congrats! You\'re from greatest country in the world!'); | |
}, "jsonp"); | |
} |
This file contains hidden or 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 os = require('os'); | |
var ifaces = os.networkInterfaces(); | |
for (var dev in ifaces) { | |
var alias = 0; | |
ifaces[dev].forEach(function(details) { | |
if (details.family == 'IPv4') { | |
if (details.address == '127.0.0.1') { | |
return; | |
} | |
++alias; |
This file contains hidden or 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 links = { | |
tracker(e) { | |
e = window.e || e; | |
if (e.target.tagName !== 'A') { | |
return; | |
} | |
links.track(e.target.href); | |
}, | |
track(url) { | |
ga('send', 'event', 'outbound', 'click', url, { |
This file contains hidden or 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
<select name="alphabet"> | |
<option value="А">А</option> | |
<option value="Б">Б</option> | |
<option value="В">В</option> | |
<option value="Г">Г</option> | |
<option value="Д">Д</option> | |
<option value="Е">Е</option> | |
<option value="Ё">Ё</option> | |
<option value="Ж">Ж</option> | |
<option value="З">З</option> |
This file contains hidden or 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 loadScript = function() { | |
window._player = false; | |
var updateTitle = function(songTitle, songArtists) { | |
document.title = songTitle + ' — ' + songArtists; | |
} | |
for (var i in Mu.blocks.binding) { | |
if (Mu.blocks.binding[i].type == 'volume') { | |
window._player = Mu.blocks.binding[i].block.player; | |
break; |
This file contains hidden or 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
<div class="container" ng-app="OpenDataApp" ng-controller="TableCtrl"> | |
<div class="form-group"> | |
<input class="form-control input-lg search" type="search" name="search" id="search" placeholder="Введите название данных" ng-model="searchText"/> | |
</div> | |
<table class="table table-striped table-hover"> | |
<thead> | |
<tr> | |
<td>Название данных</td> | |
<td>Имя данных в API</td> | |
</tr> |
This file contains hidden or 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
let lastSelectedText; | |
const SLACK_HOOK_URL = 'URL TO INCOMING HOOK'; | |
$(document).keydown(e => { | |
if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey) { | |
const selectedText = utils.getSelectionText(); | |
if ( | |
lastSelectedText === selectedText || | |
selectedText.replace(/ /g, '') === '' | |
) { | |
console.warn('Текст не выделен или это повторная ошибка'); |
This file contains hidden or 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
navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage) |
OlderNewer