Skip to content

Instantly share code, notes, and snippets.

View tajnymag's full-sized avatar

tajnymag

  • Sator Controls
  • Prague
View GitHub Profile
@patoi
patoi / docserver.service
Last active May 15, 2024 14:54
Using systemd for nodejs process with nvm
[Unit]
Description=Document Server Daemon
[Service]
Type=forking
Environment=NODE_VERSION=12
WorkingDirectory=/home/your_user/your_node_app_dir
ExecStart=/home/your_user/.nvm/nvm-exec npm start
StandardOutput=
User=your_user
@mill1000
mill1000 / README.md
Last active July 5, 2024 08:18
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@jkoelker
jkoelker / gaming
Last active June 3, 2023 23:30
Enable or Disable the Touchpad while typing via libinput `xinput` (aka. libinput "gaming" mode)
#!/bin/sh
#
# libinput by default will disable the touchpad while a key is pressed.
# to disable this, run `xinput` to list the inputs. find the name of your
# touchpad (mine is 'Microsoft Surface Keyboard Touchpad').
#
# Disable the setting 'Disable While Typing Enabled'
# `xinput --set-prop 'Microsoft Surface Keyboard Touchpad' \
# 'libinput Disable While Typing Enabled' 0`
#
@debloper
debloper / 9GAG.js
Last active November 15, 2021 07:35
Unlock NSFW without logging in
// Remap $ to jQuery object
var $ = jQuery;
// The real fun begins... first catch all the post-anchors & loop on them
$(document).on("scroll", function () {
// Let's declare some reusable globals for the next iterations
var urlBase = "http://img-9gag-lol.9cache.com/photo/";
$(".badge-evt.badge-nsfw-entry-cover").each(function () {
// Remove the NSFW class, to avoid redundant processing
@phg1024
phg1024 / threadexample.cpp
Last active November 9, 2023 08:06
a simple thread example to show thread-safe vector operation
#include <iostream>
#include <concurrent_vector.h>
#include <thread>
#include <algorithm>
#include <cstdlib>
#include <atomic>
#include <vector>
#include <mutex>
int counter = 0;
void main_vertex( float4 position : POSITION,
out float4 oPosition : POSITION,
float2 texCoord : TEXCOORD0,
out float2 oTexCoord : TEXCOORD0,
uniform float4x4 modelViewProj )
{
oPosition = mul(modelViewProj, position);
oTexCoord = texCoord;
}
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: