Skip to content

Instantly share code, notes, and snippets.

tmenier / NewtonsoftJsonSerializer.cs
Created June 4, 2022 21:36
A Newtonsoft-based JSON serializer for Flurl.Http 4+
using System.IO;
using Newtonsoft.Json;
namespace Flurl.Http.Configuration
/// <summary>
/// ISerializer implementation based on Newtonsoft.Json.
/// Default serializer used in calls to GetJsonAsync, PostJsonAsync, etc.
/// </summary>
public class NewtonsoftJsonSerializer : ISerializer

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
pR0Ps /
Last active March 28, 2024 10:01
Script to generate wireguard configs for clients to allow them to connect to the local wireguard server
# Setup
### Enable IPv4/6 forwarding:
# # In /etc/sysctl.d/30-ipforward.conf :
# net.ipv4.ip_forward=1
# net.ipv6.conf.default.forwarding=1
# net.ipv6.conf.all.forwarding=1
androidneha / adb_commands.MD
Last active July 4, 2024 12:21
Some adb commands to change setting for battery optimisation, start service, stop service, grant permission, revoke permission and etc.

To list-up installed app

pm list packages

Search for a particualr app with pacakagename

pm list pacakges | grep

Turn on Battery Optimization for a particular app

adb shell dumpsys deviceidle whitelist -<package_name>

Turn off Battery Optimization for a particular app

DallasO / .bash_aliases
Last active April 14, 2023 23:38
My Bash aliases
alias x='exit'
alias c='clear'
alias ll='ls -lh' # List files/dirs, `-l` with more details, `-h` show filesize in human-readable format
alias grep='grep --color=auto' # COLORSS!
## Routine
alias update='sudo apt update && apt list --upgradeable' # Check for updates
alias upgrade='sudo apt upgrade --auto-remove' # Install those updates
alias autoremove='sudo apt autoremove && sudo apt autoclean' # Run every few months to clear apt cache
alias aptinstall='sudo apt install' # Install something from apt
chrismccord /
Last active June 16, 2023 06:22
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new project generator

The mix archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

lavalake / gist:d83a5bc14284161433019475013996d1
Created October 14, 2017 01:54 — forked from tsohr/gist:5711945
Android activity manager "am" command help
adb shell am
usage: am [subcommand] [options]
usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]
[--R COUNT] [-S] [--opengl-trace] <INTENT>
am startservice <INTENT>
am force-stop <PACKAGE>
am kill <PACKAGE>
am kill-all
am broadcast <INTENT>
am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w]
TomTasche / nginx.conf
Last active January 27, 2023 21:22
config for nginx to proxy a specific path to an S3 bucket
# copied from default config
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/;
events {
worker_connections 1024;
LostKobrakai /
Last active April 7, 2020 20:07 — forked from nahtnam/
Using Laravel-Mix with Phoenix


Laravel-Mix is "an elegant wrapper around Webpack for the 80% use case". It has nothing to do with Elixir's Mix and does not require Laravel to work!

Set up

Create a new phoenix application with mix You may choose to add the --no-brunch flag to stop brunch from being intiailized, but I personally prefer leaving that in and replacing brunch so that the folder structure is set up for me.

$ mix demo

Install Laravel-Mix

dankrause / postgresql_recursive.sql
Last active February 26, 2024 16:03
An example of creating a recursive postgresql query to generate data about parent-child relationships within a single table.
parent INTEGER
INSERT INTO test (id, parent) VALUES
(1, NULL),
(2, 1),