Skip to content

Instantly share code, notes, and snippets.

View navanchauhan's full-sized avatar
👻

Navan Chauhan navanchauhan

👻
View GitHub Profile
@tech234a
tech234a / README.md
Last active June 10, 2023 14:03
Using unmodified third-party Reddit apps with a custom server
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active November 18, 2024 22:53
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@Julian-Nash
Julian-Nash / flask_sitemap_generator.py
Last active August 16, 2024 13:49
Flask dynamic sitemap generator
@app.route("/sitemap")
@app.route("/sitemap/")
@app.route("/sitemap.xml")
def sitemap():
"""
Route to dynamically generate a sitemap of your website/application.
lastmod and priority tags omitted on static pages.
lastmod included on dynamic content such as blog posts.
"""
from flask import make_response, request, render_template
/* Linear-chain の CRF (Conditional Random Field)
* 使い方は一番下 */
Number.prototype.exp = function() { return Math.exp(this) };
Array.prototype.sum = function() {
return this.reduce(function(x,y) { return x+y }) };
function iota(n,b,s) {
b = b||0; s = s||1;
for (var ret=[], i=0; i<n; ++i) ret.push(b+i*s);
return ret }