Skip to content

Instantly share code, notes, and snippets.

View Matrixbirds's full-sized avatar

matrixbirds Matrixbirds

View GitHub Profile
@ibLeDy
ibLeDy / desktop_chromium_flags.md
Last active April 3, 2024 21:56
Chromium flags
Updated: Jun 17, 2022
Chromium: 102.0.5005.115 (Official Build) (64-bit) (cohort: Stable)
OS: Windows 10 Version 21H2 (Build 19044.1766)

Override software rendering list - Enabled

Overrides the built-in software rendering list and enables GPU-acceleration on unsupported system configurations. – Mac, Windows, Linux, Chrome OS, Android

@Kolcha
Kolcha / build_qbt_dmg.sh
Last active April 24, 2024 17:01
script to build qBittorrent master branch with Qt6 on macOS, no Homebrew required! NO LONGER MAINTAINED!!! see comments to find forks.
#!/bin/zsh
# standalone script to build qBittorent for macOS (including Apple Silicon based Macs)
#
# only Xcode must be installed (Xcode 12 is required to produce arm64 binaries)
# all required dependencies and tools are automatically downloaded and used only from script's working directory
# (can be specified), nothing is installed into the system
# working directory is removed on completion if it was not specified
#
# by default script produces binaries for the architecture it was launched on, but cross-compilation is also supported
# in both directions, i.e. x86_64 -> arm64 and arm64 -> x86_64
function lodash (obj) {
var createProxy = function (obj) {
return new Proxy(obj, {
get (target, name) {
if (_[name]) {
return function (...args) {
var result = _[name](target, ...args)
if (typeof result === 'object') {
return createProxy(result)
} else {
@Matrixbirds
Matrixbirds / basic-recipes.osx.sh
Last active August 12, 2017 17:42
network-dump-recipes
# tcpdump usage recipes:
# tcpdump -i <interface> <BPF: Berkeley Packet Filter> [options]
sudo tcpdump -i lo0 '(host localhost) and (port 4399)' -vvv -tt 4
# watch with pipe chain command
watch -cd 'netstat -tan | head -n2; netstat -tan | sort | egrep 4399'
# netstat usage recipes:
# netstat [options]
@aaronhoffman
aaronhoffman / pre-commit
Created April 14, 2017 15:25
git hooks - prevent commit to local master branch and prevent push to remote master branch
#!/bin/sh
# prevent commit to local master branch
branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/master" ]; then
echo "pre-commit hook: Can not commit to the local master branch."
exit 1
fi
exit 0
@Matrixbirds
Matrixbirds / nginx.conf
Last active August 25, 2016 08:18
A simple SPA Nginx demo
## try_files all request except /api, /admin/api
upstream backend_api {
server ip_address;
}
server {
listen 80;
server_name t66y.domain.com;
index index.html;
charset utf-8;
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@d-akara
d-akara / JavaScriptSafeNavigation.md
Last active April 11, 2024 16:18
JavaScript Safe Navigation

Experimental Safe JavaScript Navigation

Implemented using ES6 Proxies and Symbols

The purpose of this function is to provide a way to avoid deep nested conditionals when traversing a hierarchy of objects. Some languages use an operator such as '?.' to perform this capability. This is sometimes called safe navigation or null conditional operators.

You can somewhat think of this as how a xpath select works. If any nodes along the path are not found, your result is simply not found without throwing an exception and without needing to check each individual node to see if it exists.

Suggestions for improvements welcome!

@volodymyrprokopyuk
volodymyrprokopyuk / railway_oriented_programming.js
Last active October 6, 2020 04:50
Railway Oriented Programming (JavaScript)
var _ = require('lodash');
var Success = function(success) { this.success = success; };
var Failure = function(failure) { this.failure = failure; };
var bindAll = function(fs) {
var bind = function(res, f) {
return res instanceof Success ? f(res.success) : res;
};
var bindF = function(f) { return _.partial(bind, _, f); };
@MikeBild
MikeBild / async-either-with-promise.js
Last active November 10, 2018 15:40
Async Railway Oriented Programming in JS
#!/bin/env node
//thx to http://fsprojects.github.io/Chessie/a-tale-of-3-nightclubs.html
Promise.all([
suitablePersonEnterGayBar(),
unsuitablePersonEnterGayBar(),
])
.then(result => result.map((person, i) => `Person ${i+1}: ${person.cost || ''}${person.reasons.join(' ')}`))
.then(result => console.log(`Person entries\n${result.join('\n')}`));