Skip to content

Instantly share code, notes, and snippets.

View abishekmuthian's full-sized avatar
💭
@Abishek_Muthian

Abishek Muthian abishekmuthian

💭
@Abishek_Muthian
View GitHub Profile
@HananoshikaYomaru
HananoshikaYomaru / fix.css
Last active December 15, 2024 22:30
life calendar in obsidian using dataview js
/* wide */
.wide .markdown-preview-sizer {
max-width: unset !important;
}
.life-calendar p a.internal-link {
display: inline-block;
}
@lupyuen
lupyuen / zig-termux.md
Last active January 13, 2025 15:31
Install Zig in Termux Android

Install Zig in Termux Android

Here are the steps to install Zig Compiler in Termux Android...

Install Termux from F-Droid, because the Google Play version is outdated...

Launch Termux on Android and enter...

@lamperez
lamperez / cs35l41_spi.md
Last active March 27, 2025 11:37
CS35L41 amplifiers in an ASUS Zenbook on linux

Asus Zenbook UX3402 speakers on Linux

Important

THIS IS NOW OBSOLETE WITH KERNEL VERSIONS ≥ 6.7.0

A recent announcement in the kernel mail list by Cirrus developers will solve the problem described here. Therefore, the proposed solutions will be soon obsolete. See this comment (thanks, @flukejones, for the tip).

I got the speakers working on my Asus Zenbook 14 OLED UX3402, the one with Intel CPU and the two CS35L41 audio amplifiers connected over SPI (not the UM3402YA, with AMD and I²C). The amplifiers are supported by the snd_hda_scodec_cs35l41 module in recent kernel versions, but they require some model-specific configuration paramaters, that should be provided by

@actuallymentor
actuallymentor / commands.sh
Last active November 18, 2021 12:42
Android Shell Commands (for use with Tasker or adb)
##
# These commands can all be run as Tasker shell commands, or through adb
# NOTE ON ROOT: I noticed many commands work through the adb shell, but fail in tasker unless using ROOT. If you tasks fail, try enabling root for it
##
## SETTING THINGS
# Enable deep doze
dumpsys deviceidle force-idle
@erangaeb
erangaeb / redis-sadd.go
Last active May 17, 2022 09:30
redis SADD with golang
func sadd(key string, val string) error {
// get conn and put back when exit from method
conn := pool.Get()
defer conn.Close()
_, err := conn.Do("SADD", key, val)
if err != nil {
log.Printf("ERROR: fail add val %s to set %s, error %s", val, key, err.Error())
return err
}
@mrispoli24
mrispoli24 / setting-up-heroku-and-cloudflare.md
Created October 15, 2018 18:41
Setting up Heroku and Cloudflare (the right way)

Setting up Heroku and Cloudflare (the right way)

The following outlines how to setup Heroku + Cloudflare with a full SSL certificate. What this means is that communication between the browser and the Cloudflare CDN is encrypted as well as communication between Cloudflare and Heroku’s origin server. Follow these steps exactly and the setup is a breeze.

Step 1: Set up domain names in Heroku

First you want to add the root domain and the www domain to heroku. You do this by clicking into your production application, then going to settings and then scrolling down to Domains and certificates.

Here you will add <your_domain>.com and www.<your_domain>.com. This will give you two CNAME records. They will look something like <your_domain>.com.herokudns.com and www.<your_domain>.com.herokudns.com.

Step 2: Add CNAME records to Cloudfare.

@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:02
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
@javascriptlove
javascriptlove / cleanup.js
Created May 22, 2018 13:07
Remove orphan GridFS chunks from MongoDB
var i = 0;
var orphans = 0;
db.fs.chunks.find({}, { files_id: 1 }).forEach(function(chunk) {
i++;
if (i % 100 === 0) {
print(i);
}
if (!db.fs.files.findOne({ _id: chunk.files_id }, { _id: 1 })) {
print("orphan " + chunk._id);
db.fs.chunks.remove({ _id: chunk._id });
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 5, 2025 21:07
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@mrnugget
mrnugget / go-sqlite3_database_is_locked.go
Created March 3, 2016 05:58
Program that tests the concurrency issues with go-sqlite3. This will create two tables: `products` and `users`. One goroutine will repeatedly read from the `products` table in N fresh goroutines. At the same time ONE goroutine writes to the other table.
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"sync"
"time"