Skip to content

Instantly share code, notes, and snippets.

View r6m's full-sized avatar
🏠
Working from home

Reza r6m

🏠
Working from home
  • localhost
View GitHub Profile
@dopey
dopey / main.go
Last active June 26, 2024 13:38 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@wfjsw
wfjsw / tl_convert.js
Last active January 20, 2020 08:10
Convert TL-Schema File to JSON
'use strict';
var fs = require('fs')
var args = process.argv.slice(2);
// From https://github.com/lodash/lodash/blob/4.17.4/lodash.js#L6891
function compact(array) {
var index = -1,
length = array == null ? 0 : array.length,
@DarinM223
DarinM223 / Concepts.md
Last active June 24, 2024 12:55
Rust concept explanations

My explanation of the main concepts in Rust

There are three main concepts with Rust:

  1. Ownership (only one variable "owns" the data at one time, and the owner is in charge of deallocating)
  2. Borrowing (you can borrow a reference to an owned variable)
  3. Lifetimes (all data keeps track of when it will be destroyed)

These are fairly simple concepts, but they are often counter-intuitive to concepts in other languages, so I wanted to give a shot at

@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers