Skip to content

Instantly share code, notes, and snippets.

View denysvitali's full-sized avatar

Denys Vitali denysvitali

View GitHub Profile
@Tydus
Tydus / howto-standalone-toolchain.md
Last active March 1, 2026 16:26
How to install Standalone toolchain for Android

HOWTO Cross compiling on Android

5W1H

What is NDK

NDK (Native Develop Toolkit) is a toolchain from Android official, originally for users who writes native C/C++ code as JNI library. It's not designed for compiling standalone programs (./a.out) and not compatible with automake/cmake etc.

What is Standalone Toolchain

"Standalone" refers to two meanings:

  1. The program is standalone (has nothing connect to NDK, and don't need helper scripts to run it)
  2. The toolchain is made for building standalone programs and libs, and which can used by automake etc.

(Optional) Why NDK is hard to use

By default, NDK uses android flavor directory structure when it's finding headers and libs, which is different from GNU flavor, so the compiler cannot find them. For Example:

/**
* Function for generating ESR-numbers for orange swiss payment slips (so called "Oranger Einzahlungsschein").
*
* @author Jason Rubichi, Nicolas Zanotti
* @param
* bc: fix, 01 or 04
* chf: dynamic, amount in chf without rappen, must have eight chars minimum (if less than eight chars, insert zeros before)
* rappen: dynamic, amount in rappen
* help1, help2, help3: fix, "+" or ">", no editing required
* referenceNumber: dynamic, contains matag number, zeros, client number and job number
@roooodcastro
roooodcastro / GraphPanel.java
Last active May 24, 2024 15:40
A simple Swing component to draw a Graph over a regular JPanel. Features a grid, customizable amount of hatch marks, axis labels,checking for minimum and maximum value to label correctly the Y-axis and customizable padding and label padding. Based on "Hovercraft Full Of Eels"'s answer on StackOverflow (http://stackoverflow.com/questions/8693342/…
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.util.ArrayList;
@jbonney
jbonney / spotify_keybindings
Created June 9, 2013 13:22
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@EugeneKud
EugeneKud / gist:5057685
Created February 28, 2013 15:47
LATEX : Swiss Letter
\documentclass[fontsize=12pt,paper=a4]{scrlttr2}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\LoadLetterOption{SN} %Swiss Letter standards
\KOMAoptions{
enlargefirstpage=true, % letter should hold on one page
headsepline=false,
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active September 12, 2026 05:08
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname