Skip to content

Instantly share code, notes, and snippets.

View kiprasmel's full-sized avatar

Kipras Melnikovas kiprasmel

View GitHub Profile
bindsym $mod+h focus left
bindsym $mod+Shift+h move left 30
bindsym $mod+j focus down
bindsym $mod+Shift+j move down 30
bindsym $mod+k focus up
bindsym $mod+Shift+k move up 30
bindsym $mod+l focus right
@kiprasmel
kiprasmel / stdin.cpp
Last active February 4, 2021 21:08
stdin parsing with simple streams
#include <bits/stdc++.h>
using namespace std;
int main() {
// replace this with `cin` or `ifstream` or whatever)
stringstream ss("ayyy lmao asd_qwe: 69, 420,1337, nice yo\nhehe xd: 1, 2, 3, kekw pog");
string a, b, c;
getline(ss, a, ' '); // ayyy (till space)
getline(ss, b, ' '); // lmao (till space)
@kiprasmel
kiprasmel / iptables_reset.sh
Last active February 9, 2021 14:42
iptables_reset.sh - whitelist must-haves, block everything else 🥳
#!/usr/bin/env sh
# iptables_reset.sh
# get via e.g. curl ifconfig.me
MY_LOCAL_IP=""
[ -z "$MY_LOCAL_IP" ] && {
printf "
usage:
add your local ip inside to the script, then
@kiprasmel
kiprasmel / deploy.sh
Created January 18, 2021 17:03
simple docker deploy.sh
#!/usr/bin/env bash
USER="kipras"
NAME="turbo-schedule"
TAG="$1"
[ -z "$TAG" ] && TAG="latest"
docker stop "$NAME"
docker rename "$NAME" "$NAME".old
@kiprasmel
kiprasmel / autoexec.cfg
Last active August 5, 2022 01:22
csgo cfg
//-- Autoexec --
// Scripts
#include <sourcemod>
#include <sdktools> /** ForcePlayerSuicide */
public Plugin myinfo = {
name = "Anti-respawn on reconnect",
author = "Kipras Melnikovas (https://kipras.org) <kipras@kipras.org>",
description = "Disallow clients from respawning after being spawned and reconnecting",
version = "0.1.0",
url = "https://kipras.org"
};
#include <sourcemod>
public Plugin myinfo = {
name = "Get IP",
author = "Kipras Melnikovas (https://kipras.org) <kipras@kipras.org>",
description = "Get an IP address of a target",
version = "0.1.0",
url = "https://kipras.org"
};
/**
*
* part 1
*
* @param {string} input
* @returns {number} length of the polymer after all resulting reactions
*/
function alchemicalReduction(input) {
let lastAnswer = -1;
@kiprasmel
kiprasmel / git-workflow.md
Created February 23, 2020 13:17
Git Workflow

What I do myself & highly recommend too:

Use feature branches for features Once the feature is done, rebase it to origin/master Then merge it into master with --no-ff to intentionally create a merge commit.

This produces a very clean commit history - you know which commits came from a specific feature branch, and which ones were commited straight into master.

Take a look at my recent project as an example -- https://github.com/sarpik/turbo-schedule

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>JS Crash Course</title>
</head>
<body>
<header>