Skip to content

Instantly share code, notes, and snippets.

View dryaf's full-sized avatar
💭
show me the way to grayskull

dryaf dryaf

💭
show me the way to grayskull
  • secret
  • Austria
View GitHub Profile
package main
import (
"flag"
"log"
"net/http"
"strings"
)
// FileSystem custom file system handler
@ogero
ogero / OPENCV341_Android_compile.MD
Last active January 12, 2022 05:33
This process explains how to compile shared libs of opencv and contrib modules from sources for Android ABI `abi-armeabi-v7a`

Compilation of OpenCV & contrib modules from sources for Android

This process explains how to compile shared libs of opencv and contrib modules from sources for Android ABI abi-armeabi-v7a.

##Requirements

  • Sources for opencv-3.4.1
  • Sources for opencv_contrib-3.4.1
  • CMake 3.11.3
  • mingw-w64 x86_64-7.3.0-posix-seh-rt_v5-rev0
@agusmakmun
agusmakmun / element.html
Last active July 12, 2019 09:47
spfjs progress bar: https://github.com/youtube/spfjs (JS framework for fast navigation)
<html>
<head>
<link rel="stylesheet" href="/css/progress-bar.css">
</head>
<body>
<h1>Your element goes here...</h1>
<!-- Link disabled: static link, SPF ins disabled -->
<a href="/destination">Go!</a>
@apolloclark
apolloclark / postgres cheatsheet.md
Last active June 14, 2024 08:25
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@postmodern
postmodern / rip_dvd
Last active January 1, 2024 00:22
Script to automate ripping DVDs using Handbrake-CLI and mkvmerge
#!/usr/bin/env bash
#
# Author: postmodern
# Description:
# Rips a DVD to a H.264 MKV file, with chapters and tags. Ignores any
# bad blocks or sectors on the DVD.
# Dependencies:
# * gddrescue
# * handbrake-cli
# * mkvtoolnix
@jpillora
jpillora / sshd.go
Last active December 17, 2023 16:27
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@olov
olov / gist:eb60ab878eb73a7c5e22
Created October 15, 2014 08:55
listenandservetls_nossl30.go
// You don't want to serve HTTPS supporting for SSL3.0 any longer, see:
// http://googleonlinesecurity.blogspot.de/2014/10/this-poodle-bites-exploiting-ssl-30.html
import (
"crypto/tls"
"net/http"
)
// This code supports SSL3.0, TLS1.0, TLS1.1 and TLS1.2
// Chances are you currently do this but want to stop due to the POODLE
err := http.ListenAndServeTLS(addr, "crtfile", "keyfile", handler)
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API
@jpetazzo
jpetazzo / README.md
Last active June 16, 2024 00:08
Manual custom geocoding using OSM database

Someone asked how to get the latlong from a specific road near a town on OpenStreetMap.

If you need to do it only once (e.g., you're about to go on a trip, and your GPS cannot find your destination city, but allows you to enter GPS coordinates), you can use Nominatim, OpenStreetMap's geocoding interface.

If you need to do it multiple times, in a programmatic manner, there are at least two ways to do that.

Note: I worked with OSM data a couple of years ago, but I don't have an OSM database on my local laptop right now, so some instructions will be a bit fuzzy. I do apologize in advance.

PostGIS queries on a local OSM DB

@temoto
temoto / aes-cfb-example.go
Created February 27, 2013 22:37
Example of AES (Rijndael) CFB encryption in Go. IMHO, http://golang.org/pkg/crypto/cipher/ could benefit a lot from similar snippet.
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func EncryptAESCFB(dst, src, key, iv []byte) error {
aesBlockEncrypter, err := aes.NewCipher([]byte(key))