Skip to content

Instantly share code, notes, and snippets.

View hXtreme's full-sized avatar
:octocat:
Improving your experience. Please wait...

Harsh Parekh hXtreme

:octocat:
Improving your experience. Please wait...
View GitHub Profile
@hXtreme
hXtreme / condensed-docker-grammer.markdown
Last active February 13, 2021 13:01
Condensed Dockerfile grammer

Docker YAML config syntax

The syntax is mostly as following:

# parser directives

ARG arg_name=arg_val
FROM image:tag

Created for use with https://github.com/zvxryb/Linux-Virtual-Joystick

Add both files to ~/.config/vjoy/modules/

Edit mouse2joy.py and change paths accordingly to match your username (not "zezic").

Then run vjoy from its folder with ./vjoy mouse2joy

diff --git a/setup b/setup
index 18b6a93..3907d84 100755
--- a/setup
+++ b/setup
@@ -1,7 +1,7 @@
#! /bin/sh
-PKG_MGR=pacman
-PKG_MGR_INSTALL=-S
+PKG_MGR=apt
@hXtreme
hXtreme / plot.py
Created March 4, 2020 17:49
Use this instead of matplotlib
# Note to self use seaborn instead of matplotlib
import seaborn as sns
sns.set(style='ticks', palette='Set2')
sns.despine()
# The above would setup seaborn to use prettyplotlib style see: https://github.com/olgabot/prettyplotlib
@hXtreme
hXtreme / Page1.md
Last active July 6, 2020 05:27
Jekyll⨯Github - Static site generation tutorial

Jekyll⨯Github

<[PREV]|[NEXT]>

What the static site generator?

A static site is a collection of pages containing just basic HTML, CSS and JS files.

A static site generator generates a static site from other (usually easier to work with) files.

@hXtreme
hXtreme / lut.py
Created February 16, 2020 05:59
Bit-reversal lookup table
val = [[ 0, 2, 1, 3, ],
[ 0, 4, 2, 6, 1, 5, 3, 7, ],
[ 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15, ],
[ 0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31, ],
[ 0, 32, 16, 48, 8, 40, 24, 56, 4, 36, 20, 52, 12, 44, 28, 60, 2, 34, 18, 50, 10, 42, 26, 58, 6, 38, 22, 54, 14, 46, 30, 62, 1, 33, 17, 49, 9, 41, 25, 57, 5, 37, 21, 53, 13, 45, 29, 61, 3, 35, 19, 51, 11, 43, 27, 59, 7, 39, 23, 55, 15, 47, 31, 63, ],
[ 0, 64, 32, 96, 16, 80, 48, 112, 8, 72, 40, 104, 24, 88, 56, 120, 4, 68, 36, 100, 20, 84, 52, 116, 12, 76, 44, 108, 28, 92, 60, 124, 2, 66, 34, 98, 18, 82, 50, 114, 10, 74, 42, 106, 26, 90, 58, 122, 6, 70, 38, 102, 22, 86, 54, 118, 14, 78, 46, 110, 30, 94, 62, 126, 1, 65, 33, 97, 17, 81, 49, 113, 9, 73, 41, 105, 25, 89, 57, 121, 5, 69, 37, 101, 21, 85, 53, 117, 13, 77, 45, 109, 29, 93, 61, 125, 3, 67, 35, 99, 19, 83, 51, 115, 11, 75, 43, 107, 27, 91, 59, 123, 7, 71, 39, 103, 23, 87, 55, 119, 15, 79, 47, 111, 31, 95, 63, 1
% --- Radix-2 Decimation In Frequency - Iterative approach
clear all
close all
clc
% --- N should be a power of 4
N = 1024;
% x = randn(1, N);
---
Language: Cpp
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: false
AlignTrailingComments: false
@hXtreme
hXtreme / Checkout.md
Last active September 13, 2022 19:55
A list of Interesting things.

Checkout

Entry format: For interesting/usefull thing, checkout


  • For a real life example of Kodein, checkout.
  • For documentation about Github actions, checkout.
  • For tutorial on how to use Github secrets, checkout
  • For a free book on UI recomended by Brian Kernighan, checkout.
@hXtreme
hXtreme / vid-tweet.sh
Created July 20, 2019 17:32
ffmpeg-twitter
ffmpeg -i $input -vcodec libx264 -pix_fmt yuv420p -strict -2 -acodec aac ${input%.*}.mp4