Skip to content

Instantly share code, notes, and snippets.

View haxpor's full-sized avatar
🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller

Wasin Thonkaew haxpor

🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller
View GitHub Profile
@crallen
crallen / SnakeCaseContractResolver.cs
Created February 26, 2014 20:46
Json.NET contract resolver that uses Ruby-style lowercase with underscore naming conventions.
using Newtonsoft.Json.Serialization;
namespace ConsoleApplication3
{
public class SnakeCaseContractResolver : DefaultContractResolver
{
protected override string ResolvePropertyName(string propertyName)
{
return GetSnakeCase(propertyName);
}
@vaiorabbit
vaiorabbit / Building libglfw.dylib on macOS (Apple Silicon)
Last active September 8, 2022 13:10
Building libglfw.dylib on macOS (Apple Silicon)
$ curl -L https://github.com/glfw/glfw/releases/download/3.3.2/glfw-3.3.2.zip > glfw-3.3.2.zip
$ unzip glfw-3.3.2.zip
$ cd glfw-3.3.2/
$ mkdir build
$ cd build
$ export MACOSX_DEPLOYMENT_TARGET=10.14
$ cmake -D CMAKE_BUILD_TYPE=Release -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang ../
$ make
$ ls -l src/libglfw*
@githubutilities
githubutilities / README.md
Last active October 21, 2022 02:23
Shadowsocks proxy and ssh proxy

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@cpliakas
cpliakas / gorilla-mux-json
Created November 1, 2014 21:08
Gorilla Mux return JSON payload
package main
import (
"log"
"net/http"
"github.com/bitly/go-simplejson"
"github.com/gorilla/mux"
)
@alistairewj
alistairewj / install-postgres-10-ubuntu.md
Last active January 4, 2023 19:36
Install PostgreSQL 10 on Ubuntu

Install PostgreSQL 10 on Ubuntu

This is a quick guide to install PostgreSQL 10 - tested on Ubuntu 16.04 but likely can be used for Ubuntu 14.04 and 17.04 as well, with one minor modification detailed below.

(Optional) Uninstall other versions of postgres

To make life simple, remove all other versions of Postgres. Obviously not required, but again, makes life simple. If you have data in your previous version of postgres that you'd like to retain, then this is not recommended. Instead, you'll have to use pg_upgrade or pg_upgradecluster.

@ksmandersen
ksmandersen / install.sh
Created October 13, 2017 11:34
Install curl 7.56.0 with OpenSSL & HTTP2 support on Ubuntu 14.04.5 LTS
apt-get update
apt-get install -y build-essential curl
apt-get -y install git g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools
git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
autoreconf -i
automake
autoconf
./configure
make
@kharrison
kharrison / CoreDataController.swift
Last active January 31, 2023 22:36
Swift wrapper for NSPersistentContainer - Easy Core Data Setup with iOS 10
//
// CoreDataController.swift
//
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright
@aldemirenes
aldemirenes / android_build_run.sh
Last active May 4, 2023 10:27
Shell scripts for Android development without needing to use Android Studio
#!/bin/sh
package_name=$1
./gradlew assembleDebug
adb -d install -r app/build/outputs/apk/app-debug.apk
adb shell monkey -p "$package_name" -c android.intent.category.LAUNCHER 1
./logcat.sh "$package_name"
@jace
jace / denoise.sh
Last active October 11, 2023 10:17
Remove noise from video using sox and ffmpeg
# 1. extract audio from all videos (assuming .mp4 videos).
for FILE in *.mp4; do ffmpeg -i $FILE ${FILE%%.mp4}.wav; done
# 2. use the first second of the first audio file as the noise sample.
sox `ls *.wav | head -1` -n trim 0 1 noiseprof noise.prof
# Replace with a specific noise sample file if the first second doesn't work for you:
# sox noise.wav -n noiseprof noise.prof
# 3. clean the audio with noise reduction and normalise filters.
@nottux
nottux / opencl-amd_aur_ubuntu.bash
Last active October 19, 2023 20:23
bash implementation of opencl-amd AUR package, Install opencl amdgpu amdgpu-pro opencl only. Supports ubuntu and others with standard prefix
#!/bin/bash
# DO NOT run the line 167 standalone. It will remove the necessary files besides the junk!
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h\|\-\-no\-deb\|\-\-no\-install\|\-\-no\-cleaning\|\-\-assume\-debian"
then :
else echo wrong entry\(ies\) !
help=yes
fi
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h" || [ "$help" = yes ]