Skip to content

Instantly share code, notes, and snippets.

@awadhwana
awadhwana / main.go
Last active April 19, 2024 07:31
Golang: aes-256-cbc ecrypt/decrypt examples (with iv, blockSize)
package main
// Working example: https://goplay.space/#Sa7qCLm6w65
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"fmt"
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active April 18, 2024 16:35 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@yetithefoot
yetithefoot / stuns
Last active April 2, 2024 10:49 — forked from zziuni/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
@jhjguxin
jhjguxin / nginx-403-forbidden-error-hosting-in-user-home-directory.md
Created August 12, 2013 05:40
nginx 403 forbidden error when server static file under user home directory
@fnando
fnando / dev.conf
Created July 23, 2011 09:00
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
@aescalana
aescalana / manageFlaskSession.py
Last active February 29, 2024 20:12
Decode and Encode Flask's session cookie. Great for testing purposes; only the secret key is needed
#!/usr/bin/env python
from flask.sessions import SecureCookieSessionInterface
from itsdangerous import URLSafeTimedSerializer
class SimpleSecureCookieSessionInterface(SecureCookieSessionInterface):
# Override method
# Take secret_key instead of an instance of a Flask app
def get_signing_serializer(self, secret_key):
if not secret_key:
return None
@walm
walm / main.go
Last active February 27, 2024 08:22
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@typehorror
typehorror / Flask-SQLAlchemy Caching.md
Last active February 15, 2024 14:44
Flask SQLAlchemy Caching

Flask-SQLAlchemy Caching

The following gist is an extract of the article Flask-SQLAlchemy Caching. It allows automated simple cache query and invalidation of cache relations through event among other features.

Usage

retrieve one object

# pulling one User object

user = User.query.get(1)

@adamnew123456
adamnew123456 / arithmetic.py
Last active February 11, 2024 15:49
Pratt Parser For Arithmetic Expressions
"""
This implements a fairly simple expression language via a Pratt-style parser.
The language supports fairly standard floating point literals, such as:
5
1.09
.16
12e7
@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// This example shows how to render pages that perform AJAX calls
// upon page load.
//
// Instead of waiting a fixed amount of time before doing the render,
// we are keeping track of every resource that is loaded.
//
// Once all resources are loaded, we wait a small amount of time
// (resourceWait) in case these resources load other resources.
//
// The page is rendered after a maximum amount of time (maxRenderTime)