Skip to content

Instantly share code, notes, and snippets.

View kiprasmel's full-sized avatar

Kipras Melnikovas kiprasmel

View GitHub Profile
@kiprasmel
kiprasmel / gist.md
Last active January 17, 2019 17:30
Security - SSH & GPG keys and more
@kiprasmel
kiprasmel / virtualbox-usb.md
Last active March 8, 2019 11:02
VirtualBox USB connection
@kiprasmel
kiprasmel / misc.cpp
Created March 8, 2019 11:04
C++ misc
/**
Graph implementation (edges) (look at example 2):
https://www.techiedelight.com/graph-implementation-using-stl/
C++ containers:
https://en.cppreference.com/w/cpp/container
N = max(N, max(a, b))
foo = (foo + bar + const) % const
<!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>
@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

#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"
};
#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"
};
@kiprasmel
kiprasmel / machine.js
Last active May 2, 2020 03:01
Generated by XState Viz: https://xstate.js.org/viz
/**
* see https://xstate.js.org/viz/?gist=543eafd14d94ee75901e7bfdb065b9ae
*/
// xs::StateMachine robotoBusena = {
const machine = Machine({
id: "roboto-busena",
initial: "pradine",
on: {},
states: {
/**
*
* part 1
*
* @param {string} input
* @returns {number} length of the polymer after all resulting reactions
*/
function alchemicalReduction(input) {
let lastAnswer = -1;
@kiprasmel
kiprasmel / main.cpp
Last active September 30, 2020 20:03
curl kipras.org/main.cpp -LO
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;