Skip to content

Instantly share code, notes, and snippets.

View kshaa's full-sized avatar

Krišjānis Veinbahs kshaa

View GitHub Profile
@kshaa
kshaa / gtm_debugger.html
Created August 30, 2018 08:32
A quick GTM dataLayer event debugger.
<!-- GTM DEBUGGER DEV ONLY-->
<script>
// DataLayer debugger
setTimeout(function() {
// Helpers
var entityMap = {
'&': '&amp;',
'<': '&lt;',

Keybase proof

I hereby claim:

  • I am kshaa on github.
  • I am kshaa (https://keybase.io/kshaa) on keybase.
  • I have a public key whose fingerprint is 0BD3 4451 79D1 46B0 2E34 29A7 79B0 4834 A612 2FC8

To claim this, I am signing this object:

-- Mergefile
main.cpp
-- main.cpp
#include <iostream>
#include "lib/LinkedList/LinkedList.h"
using namespace std;
int main() {
// Code here
}
#!/usr/bin/env bash
# Usage:
#
# # Compile main.cpp to merged_main.cpp
# ./merge.sh
#
# # Compile index.cpp to merged_main.cpp
# ./merge.sh index.cpp
#
# Source - https://superuser.com/questions/268344/how-do-i-delete-all-but-10-newest-files-in-linux
# Remove all files except the newest 5
preserveCount=5
path="./rotate"
ls -1tr $path | head -n "-$preserveCount" | xargs -I {} -d '\n' rm -f $path/{}
@kshaa
kshaa / braingames_bulk_lv_rules.md
Last active July 25, 2019 12:33
How to quickly download all game rules from BrainGames site

How to quickly download all game rules from BrainGames site (works on my local @ July 2019)

Go to http://www.brain-games.com/lv/noteikumi/

In the console run this to get a list of all latvian rule download links

var lvhrefs = [];
var lvimgs = document.querySelectorAll("img[src='http://www.brain-games.com/wp-content/uploads/lv.png']")
    .forEach(function(lvimg) {
        lvhrefs.push(lvimg.parentElement.href)
    })
#!/usr/bin/env bash
chain_pem="${1}"
if [[ -z "${2}" ]]; then
ssl_flags="x509 -noout -text"
else
ssl_flags="${2}"
fi
echo "SSL Flags: ${ssl_flags}\n"
#!/usr/bin/env bash
function help() {
echo "Usage $0 [TEMPLATE] [RENDER]"
echo "Replaces all instances of '\$TPL_*' in TEMPLATE and write to RENDER"
echo "If RENDER not provided, will print to stdout"
}
template="$1"
if [ -z "$template" ]
@kshaa
kshaa / shell.nix
Last active April 27, 2021 13:53
Experimental nix 3.0 on Ubuntu for flake'd shell usage
# Nix shell info:
# - This shell uses the Nix package manager `https://github.com/NixOS/nix`
# - This shell uses the experimental `nix flake` functionality:
# - See `https://nixos.wiki/wiki/Flakes`
# - See `https://www.tweag.io/blog/2020-05-25-flakes/`
# - This shell usage is described not for NixOS, but for Ubuntu, however NixOS should work too
# - If problems arise while managing nix versions, check state of nix channels:
# - `nix-channel --list`
# - `nix-channel --help`
# - `env | grep nixpkgs`
@kshaa
kshaa / streaming_webcam_ogg_with_vlc_over_http.md
Created October 15, 2021 20:58
How to stream WebCam stream in OGG format with VLC over HTTP