Skip to content

Instantly share code, notes, and snippets.

View velppa's full-sized avatar
🎯
Focusing

Pavel Popov velppa

🎯
Focusing
View GitHub Profile
@velppa
velppa / 2020-day9.clj
Created December 10, 2020 23:34
Advent Of Code
(ns day9
(:require [clojure.string :as str]))
(def input (->> (slurp "input.txt")
(#(str/split % #"\n"))
(map read-string)))
(def PREAMBLE-LENGTH 25)

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@velppa
velppa / docker.md
Last active May 30, 2019 21:29 — forked from ngpestelos/remove-docker-containers.md
Docker cheat sheet

Delete all containers

docker ps -q -a | xargs docker rm

-q prints only the container IDs -a prints all containers

@velppa
velppa / snakeAndCamel.js
Created January 21, 2019 22:31
snake meets camel
function snakeToCamel( s ) {
return s.replace(/(\_\w)/g, function(m){return m[1].toUpperCase();});
}
function camelToSnake( s ) {
return s.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase();
}
@velppa
velppa / sVim.css
Last active January 3, 2019 05:05
sVim css file
@-webkit-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
#sVim-command {
@velppa
velppa / sVim.rc
Last active December 10, 2018 11:28
sVim.rc
" mappings
map "ctrl+u" scrollPageUp
map "ctrl+d" scrollPageDown
map "backspace" goBack
map ":" toggleReader
" Settings
let blacklists = ["*://duckduckgo.com/*", "*://*.google.*/*", "*://localhost:9000/*", "*://mijn.ing.nl/*", "*://medium.com/*/edit", "*://youtube.com/*", "*://www.youtube.com/*"]
import scala.util.Try
case class Triangle(
opposite: Float,
adjacent: Float,
hypotenuse: Float
) {
require(
opposite + adjacent > hypotenuse &&
adjacent + hypotenuse > opposite &&
@velppa
velppa / rm-zcompdump.sh
Created July 20, 2017 13:56
Remove zcompdump from macOS
find /usr -path "*zcompdump*" 2> /dev/null | xargs rm
@velppa
velppa / json.sql
Created April 10, 2016 09:00
Generating JSON from Oracle Database
declare
l_xml xmltype;
l_json clob;
begin
apex_json.initialize_clob_output;
select XMLElement("obj",
XMLForest(
XMLForest(
12345 as "id"