Skip to content

Instantly share code, notes, and snippets.

View arusahni's full-sized avatar

Aru Sahni arusahni

View GitHub Profile
@ronsims2
ronsims2 / build.sh
Created May 1, 2023 02:06
Fix wasm-pack package file by adding a main entry to the package.json
#!/bin/zsh
# Run this from the root of the project!!!
wasm-pack build --target web --release
python fix_package_file.py
cd pkg
npm link
@fsimonis
fsimonis / focusrite.conf
Last active February 10, 2024 05:43
Pipewire remapping of Focusrite Scarlett 2i4 to mono input and stereo output
# This is a remapping of the Focusrite Scarlett 2i4 to Mono input and Stereo output
# Place this file in ~/.config/pipewire/pipewire.conf.d/
# Then reload pipewire sudo systemctl reload --user pipewire.service
# Use pw-link --input and pw-link --output to find the name of the output and input device.
# The list will contain one line per port, but you will need the name of the device node.
# The format is <name of the device node>:<name of the port>.
# We need to configure two loopback modules. One for the sink and one of the source
context.modules = [
#!/bin/bash
modprobe -r psmouse && modprobe psmouse
[Unit]
Description=Restart trackpad after suspend
After=basic.target suspend.target hibernate.target
[Service]
User=root
Environment=DISPLAY=:0
ExecStart=/usr/bin/restart-trackpad
[Install]
@dvergeylen
dvergeylen / README.md
Last active April 3, 2024 16:27
JSQrcode library tutorial

Introduction

This tutorial is a step by step guide on how to use the javascript QR Code scanner on a webcam video stream in browser. Some people reported experiencing problems including it in their own projets so I guess a tutorial might help others.

Step 1: Include library in <head> section

<html lang="en">
  <head>
    <script type="text/javascript" src="grid.js"></script>
    <script type="text/javascript" src="version.js"></script>
    <script type="text/javascript" src="detector.js"></script>
@roman-yepishev
roman-yepishev / dell-os-recovery-linux-mini-howto.md
Last active September 17, 2023 14:13
Dell OS Recovery Tool under Linux Mini-HOWTO

Dell OS Recovery Tool Under Linux Mini-HOWTO

Since I was unable to find a specific answer to how can one create a Dell recovery disk from within Linux, I decided to write the steps here.

If you write the CD image directly to the USB drive (or create a new partition and write it there), the laptop will not boot. You need your USB media to be in FAT32 format with the contents of the recovery ISO.

  1. Download the recovery ISO from the support section of Dell website.
  2. Insert a USB Drive with enough capacity to hold the contents of the ISO image.
  3. Format the drive and create a filesystem where $USB_DEVICE is your USB drive (check with fdisk -l, it may be
@brandonroberts
brandonroberts / async-ng-module-loader.ts
Last active April 26, 2019 12:40
Webpack Async NgModule Loader
import {Injectable, NgModuleFactory, NgModuleFactoryLoader, Compiler, Type} from '@angular/core';
class LoaderCallback {
constructor(public callback) {}
}
export let load: Type = (callback: Function) => {
return new LoaderCallback(callback);
};
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 21, 2024 02:11
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@dustin-graham
dustin-graham / ApiService.java
Created February 15, 2015 06:17
Infinite Scrolling Android RecyclerView with RxJava
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) {
return Observable.create(new Observable.OnSubscribe<List<String>>() {
@Override
public void call(final Subscriber<? super List<String>> subscriber) {
onNextObservable.subscribe(new Observer<Void>() {
int latestPage = -1;
@Override
public void onCompleted() {
subscriber.onCompleted();
@dpapathanasiou
dpapathanasiou / SchemaSpy-HOWTO.md
Last active February 17, 2024 19:45
How to use SchemaSpy to generate the db schema diagram for a PostgreSQL database

SchemaSpy is a neat tool to produce visual diagrams for most relational databases.

Here's how to use it to generate schema relationship diagrams for PostgreSQL databases:

  1. Download the jar file from here (the current version is v6.1.0)

  2. Get the PostgreSQL JDBC driver (unless your installed version of java is really old, use the latest JDBC4 jar file)

  3. Run the command against an existing database. For most databases, the schema (-s option) we are interested in is the public one: