Skip to content

Instantly share code, notes, and snippets.

@jordaaash
jordaaash / .mocharc.json
Created October 25, 2021 01:18
Mocha + TypeScript + ESM
{
"extension": ["ts"],
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"],
"spec": ["test/**/*.test.ts"]
}
@rishitells
rishitells / Jest_GitLab_CI.md
Last active May 31, 2024 07:51
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@nasrulhazim
nasrulhazim / ci.yml
Created November 20, 2020 15:32
GitHub Action - MySQL Service for Laravel with Multiple Databases
name: Unit Test
on:
push:
branches: [develop]
pull_request:
branches: [master, develop]
jobs:
PHPUnit:
@mildsunrise
mildsunrise / mysql_pcap.py
Created May 7, 2020 10:27
Script to extract statistics about MySQL queries in a .pcap.
#!/usr/bin/env python3
'''
Script to extract statistics about MySQL queries in a .pcap.
'''
import sys
from subprocess import run
import json, csv, re
args = sys.argv[1:]
if len(args) != 2:
@whiteinge
whiteinge / hello-report.txt
Last active May 11, 2024 16:36
File sizes for "hello world" in various comple-to-C and compile-to-binary languages
Default compiler settings used, unless noted otherwise. Host system is Fedora
x86_64. Linked libs produced via `ldd`.
Linked libs common to all below: linux-vdso libc ld-linux
Size Lang Specific libs Common libs
18K c - -
20K luastatic liblua libm libdl
22K vala libgobject libglib libffi libpcre libpthread
@grenzi
grenzi / Set-PsEnv.psm1
Last active February 21, 2023 23:11
sets powershell environment variables from python-dotenv formatted .env file
<#
.Synopsis
Exports environment variable from the .env file to the current process.
.Description
This function looks for .env file in the current directoty, if present
it loads the environment variable mentioned in the file to the current process.
based on https://github.com/rajivharris/Set-PsEnv
@Kovrinic
Kovrinic / .gitconfig
Last active June 7, 2024 23:02
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@tniessen
tniessen / service.md
Created October 1, 2016 11:46
Using the "service" tool with ADB and why to avoid it

As it turns out, it is not trivial to control the audio volume of an Android device using ADB. At the time of writing, the only way appears to be using the service tool. Actually, the service command allows to "connect" to a number of services (104 on Android 6.0.1) and invoke functions. Not knowing much about this tool, I managed to completely mute all sounds and speakers of my Nexus 5, and I was stuck without any sound for quite some time. I did not find a way to unmute the sound from within the system UI, so I got to dive a little deeper into this.

If you know which service you want to use, you then need to find its interface declaration. The command

service list

gives you a list of all services with the associated interfaces, if applicable:

...

26 backup: [android.app.backup.IBackupManager]

@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active June 12, 2024 13:31
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://