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 fs = require('fs'); | |
let countries = []; | |
const letters = ['s', 'u', 'o', 'm', 'i']; | |
function readLines(input, func) { | |
let remaining = ''; | |
input.on('data', data => { | |
remaining += data; | |
let index = remaining.indexOf('\n'); |
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
(•_•) | |
( •_•)>⌐■-■ | |
(⌐■_■) | |
(•_•) | |
( •_•)>⌐◄-► | |
(⌐◄_►) |
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
{ | |
"locations": [{ | |
"title": "Helsingin poliisilaitos", | |
"longtitude": "", | |
"latitude": "", | |
"palvelupiste": "False", | |
"poliisiemail": "", | |
"busses": "", | |
"img": "", | |
"ppmaanantai": "", |
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 getPosition = function (options) { | |
return new Promise(function (resolve, reject) { | |
navigator.geolocation.getCurrentPosition(resolve, reject, options); | |
}); | |
} | |
getPosition() | |
.then((position) => { | |
console.log(position); | |
}) |
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 ($) { | |
var $elements = $('#yks, #kaks'); | |
var func = function () { | |
jooh; | |
}; | |
$elements.blur(func); | |
$(function () { // jquery dom ready | |
$elements.each(func); |
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
CREATE TRIGGER username AFTER INSERT ON user FOR EACH ROW | |
IF user.displayname IS NULL THEN | |
SET user.displayname := user.username; | |
END IF;; |
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
# Jump | |
export MARKPATH=$HOME/.marks | |
function jump { | |
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" | |
} | |
function mark { | |
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1" | |
} | |
function unmark { |
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
A PIZZAA | |
A I | |
Z Z | |
Z Z | |
I A | |
PIZZAAAZZIP | |
A I | |
Z Z | |
Z Z | |
I A |
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 fib (n, x, y) { | |
if (n < 1) return; | |
console.log(n, x); | |
n--; | |
fib(n, y, x+y); | |
} | |
fib (100, 0, 1); | |
--- |
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() { | |
var showIndex = 0; | |
var titles = document.querySelectorAll('.kysymys'); | |
var questions = document.querySelectorAll('.kysymys + p'); | |
var submit = document.querySelectorAll('button[type="submit"]')[0]; | |
function hideElement (element) { | |
if (!element) { | |
return; |