Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View BrainStone's full-sized avatar
🏳️‍🌈
#lgbt

Yannick Schinko BrainStone

🏳️‍🌈
#lgbt
View GitHub Profile
out/
.idea/
*.iml
import java.util.*;
public class AdditionUnderXOR {
static final int SS = 1000000;
enum Ore {
COAL(60005),
IRON(60006),
@jellium
jellium / bash-to-zsh-hist.py
Last active January 15, 2022 20:32 — forked from muendelezaji/bash-to-zsh-hist.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@cengiz-io
cengiz-io / linux-clang-format
Last active July 23, 2020 11:16 — forked from qlyoung/linux-clang-format
Linux kernel style .clang-format
---
BasedOnStyle: LLVM
Language: Cpp
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AlwaysBreakBeforeMultilineStrings: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
@BrainStone
BrainStone / Makefile
Last active April 5, 2017 14:37
Super generic Makefile for C++
#### PROJECT SETTINGS ####
# Must be either executable, dynamic_library or static_library
# Defaults to executable if a wrong value is used!
BIN_TYPE = executable
# The name of the executable to be created
# The extension gets appended automatically based on the type
BIN_NAME := prog
# The name of the documentation file
DOC_NAME := PROG-doc
# Compiler used
@BrainStone
BrainStone / transbg.css
Created June 30, 2015 22:14
Transparent backgound texture for CSS
/* Creates that transparent background texture used by many image editing programs like gimp or PhotoShop */
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABlBMVEW/v7////+Zw/90AAAAE0lEQVR4AWOAAUYoGCCBAbcfCgBFEACB1bzUwAAAAABJRU5ErkJggg==);
@BrainStone
BrainStone / humanReadable.sh
Last active August 29, 2015 14:23
Covert bytes to a human readable format in bash
#! /bin/bash
function humanReadable {
if [ $1 -lt 1024 ]
then
printf "%4i B\n" $1
else
postfixes=(KiB MiB GiB TiB EiB PiB YiB ZiB)
bytes=$1
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote