Skip to content

Instantly share code, notes, and snippets.

View Sasha-hk's full-sized avatar
🏠
Working from home

Oleksandr Petryk Sasha-hk

🏠
Working from home
  • Ukraine
  • 02:05 (UTC +03:00)
View GitHub Profile
@mrkara
mrkara / read-key-press-cpp-linux.cpp
Last active July 21, 2024 10:07
[Read Key Press from Terminal under Linux with C++] #cpp #snippet
#include<iostream>
int main() {
char c;
// Set the terminal to raw mode
while(1) {
system("stty raw");
c = getchar();
// terminate when "." is pressed
system("stty cooked");
@jamzi
jamzi / gist:aff85aa192b8addab2b560db5d849a2a
Created January 19, 2019 16:02
Electron-builder - Building Windows app on Linux (Docker image)
docker run --rm -ti \
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}:/project \
-v ${PWD##*/}-node-modules:/project/node_modules \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine
@gbraad
gbraad / README.md
Last active July 16, 2024 17:13
Buy Me a Coffee

Buy Me a Coffee

Using inlined HTML

Buy Me A Coffee

<a href="https://www.buymeacoffee.com/gbraad" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
@rjha
rjha / gist:b7cda6312552c3e15486
Created December 26, 2015 20:45
makefile to compile Arduino Core into a static library
BIN=C:/arduino-1.0.5-r2/hardware/tools/avr/bin
TOOLS=C:/arduino-1.0.5-r2/hardware/tools/avr/bin
LIB=d:/rajeev/code/bitbucket/dl/lib
INC=d:/rajeev/code/bitbucket/dl/include
ROOT=d:/rajeev/code/bitbucket/dl
PROG=aout
MCU=atmega2560
ASRC=d:/rajeev/code/bitbucket/dl/lib/arduino
CPU_SPEED=16000000L
@rponte
rponte / get-latest-tag-on-git.sh
Last active July 4, 2024 10:55
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@hectorperez
hectorperez / copy word under cursor in Vim.txt
Created August 7, 2014 13:37
copy word under cursor in Vim
copy/delete word under cursor in Vim
yw / byw
Assuming that the cursor is at the first character of the word simply do this in command mode:
yw
y is for yank and w is for word.
Other ways of doing the same thing which are not as efficient:
vey
the v starts visual select mode. e tells vim to move to end of word. y yanks or copies the word. to delete replace y with x.
#include <stdlib.h>
#include <string.h>
#include <Nixie.h>
#include <MultiDAC.h>
#include "messaging.h"
Nixie nixie(NIXIE_PIN_DATA, NIXIE_PIN_CLK, NIXIE_PIN_LATCH);
MultiDAC barGraph(GRAPH_PIN_DATA, GRAPH_PIN_CLK, GRAPH_PIN_LATCH);
void setup() {