Skip to content

Instantly share code, notes, and snippets.

@sudokai
sudokai / deep-link-from-browser.js
Created August 5, 2023 08:42 — forked from diachedelic/deep-link-from-browser.js
Deep link to a native app from a browser, with a fallback
@sudokai
sudokai / viewimage.user.js
Created April 11, 2020 10:39 — forked from bijij/viewimage.user.js
Userscript version of the View Image chrome extension
// ==UserScript==
// @name View Image
// @namespace https://github.com/bijij/ViewImage
// @version 3.3.0
// @description This userscript re-implements the "View Image" and "Search by image" buttons into google images.
// @author Joshua B
// @run-at document-end
// @include http*://*.google.tld/search*tbm=isch*
// @include http*://*.google.tld/imgres*
// @updateURL https://gist.githubusercontent.com/bijij/58cc8cfc859331e4cf80210528a7b255/raw/viewimage.user.js
@sudokai
sudokai / trello-md-code-highlight.js
Last active August 24, 2019 13:52 — forked from AsyncWizard/trello-md-code-highlight.js
Trello markdown code syntax highlight.
// ==UserScript==
// @name Trello Syntax Highlight (fixed 2019)
// @namespace https://gist.github.com/kxlt
// @version 0.2
// @description Github syntax highlighting for Trello code blocks
// @author AsyncWizard (https://github.com/AsyncWizard>), kxlt (https://github.com/kxlt)
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/highlight.min.js
// @resource https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/styles/github.min.css
// @match https://trello.com/*
// @grant none
@sudokai
sudokai / JDBIjOOQ.java
Created September 14, 2018 16:08 — forked from stantonk/JDBIjOOQ.java
JDBI + jOOQ. Combine SQL Builder of jOOQ with all the awesomeness of JDBI, but avoid using jOOQ's codegen, having to keep it up to date with schema changes (just update the single query that's changed) or overcomplicating your build process. jOOQ never touches the database.
// see:
// http://jdbi.org/fluent_queries/
// http://www.jooq.org/doc/3.7/manual/getting-started/use-cases/jooq-as-a-standalone-sql-builder/
// Your Java Bean
public static class Reminder {
private long id;
private long customerId;
public Reminder(long id, long customerId) {
@sudokai
sudokai / bil-to-hgt.sh
Created November 5, 2017 17:46
Convert a directory of .bil files to .hgt
#!/bin/bash
function gdal_pixel_count() {
if [ -z "$1" ]; then
echo "Missing arguments. Syntax:"
echo " gdal_extent <input_raster>"
return
fi
EXTENT=$(gdalinfo $1 |\
grep "Size is" |\
sed "s/Size is //g;s/,//;s/\n//")
@sudokai
sudokai / nginx.conf
Created April 9, 2017 19:15 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@sudokai
sudokai / object-watch.js
Created March 31, 2017 08:03 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@sudokai
sudokai / centos_nspawn.md
Created March 25, 2017 13:25 — forked from bhouse/centos_nspawn.md
Centos 7.2.1511 via systemd-nspawn

Make a directory to install CentOS 7.2.1511 in

[root@localhost ~]# mkdir /centos_chroot

Make a directory for the rpm database

[root@localhost ~]# mkdir -p /centos_chroot/var/lib/rpm

Create the RPM database

@sudokai
sudokai / gitlab.conf
Created November 27, 2015 08:17 — forked from sameersbn/gitlab.conf
Nginx reverse proxy configuration for GitLab
upstream gitlab {
server 172.17.42.1:10080 fail_timeout=0;
}
# let gitlab deal with the redirection
server {
listen 80;
server_name git.example.com;
server_tokens off;
root /dev/null;
@sudokai
sudokai / jenkins_haproxy_config.cfg
Created November 26, 2015 23:15 — forked from xelwarto/jenkins_haproxy_config.cfg
Jenkins CI haproxy configuration example
global
chroot /var/lib/haproxy
crt-base /etc/pki/tls/certs
daemon
group haproxy
log 127.0.0.1 local0
maxconn 2000
pidfile /var/run/haproxy.pid
stats socket /var/lib/haproxy/stats
tune.ssl.default-dh-param 2048