Skip to content

Instantly share code, notes, and snippets.

View kiprasmel's full-sized avatar

Kipras Melnikovas kiprasmel

View GitHub Profile
@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;
{"contents":{"python":{"pythonPath":"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\python.exe"},"eslint":{"enable":true},"launch":{"version":"0.2.0","configurations":[{"type":"node","request":"launch","name":"Launch Program","program":"${workspaceFolder}\\server.js"}]}},"overrides":[],"keys":["python.pythonPath","eslint.enable","launch.version","launch.configurations"]}
@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
@kiprasmel
kiprasmel / vimium-options.json
Last active February 4, 2021 21:09
vimium-options.json -- vimium is awesome -- https://github.com/philc/vimium
{
"settingsVersion": "1.66",
"exclusionRules": [
{
"pattern": "https?://mail.google.com/*",
"passKeys": ""
},
{
"pattern": "http://127.0.0.1:5050/",
"passKeys": ""
@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: {
<!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

/**
*
* part 1
*
* @param {string} input
* @returns {number} length of the polymer after all resulting reactions
*/
function alchemicalReduction(input) {
let lastAnswer = -1;