Skip to content

Instantly share code, notes, and snippets.

$ cat t.py
from pprint import pprint
from pytheory import Tone, Fretboard, charts_for_fretboard


tones = (
    Tone.from_string("F2"),
    Tone.from_string("C3"),
    Tone.from_string("G3"),

Tone.from_string("D4"),

@1hakr
1hakr / example.com
Last active January 31, 2024 01:16
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@britonad
britonad / roles.py
Created November 20, 2017 15:46
Simple Flask MongoDB roles, permissions and decorator for views
import datetime
from functools import wraps
from werkzeug.security import (
generate_password_hash,
check_password_hash
)
from flask import abort
@mr-exception
mr-exception / main.py
Created November 10, 2017 11:51
backup from mongodb database by mongodump in python 3
import os
import time
'''
mongo backup by python
developrt: mr-exception
github: mr-exception
'''
# configs:
@sibelius
sibelius / learning.md
Last active August 23, 2023 13:21
Learning Path React Native

Basics

  • Learn how to start a new react native project
  • Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
  • Learn how to upgrade a react native project
  • Learn how to add a package to the project
  • Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
  • Learn how to use fetch to get data from your backend

Learn Navigation

@muhammadghazali
muhammadghazali / What is server_names_hash_bucket_size.md
Last active February 9, 2024 14:13
Nginx: What is server_names_hash_bucket_size?

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far:

@jtwaleson
jtwaleson / fetch.go
Created January 17, 2016 12:08
Certificate fetcher in Go
package main
import "crypto/tls"
import "crypto/sha1"
import "crypto/x509"
import "fmt"
import "encoding/pem"
import "os"
import "time"
import "bufio"

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@pfctdayelise
pfctdayelise / 00-intro_errorreporting.txt
Created August 18, 2012 13:47
Examples of pytest, especially funcargs
These are snippets of py.test in action, used in a talk given at
PyCon AU 2012 in Hobart, Tasmania. They are all relevant for
py.test 2.2 except where specified. Where taken from open source
projects I have listed a URL, some examples are from the py.test
documentation, some are from my workplace.
Apart from things called test_*, these functions should probably
be in your conftest.py, although they can generally start life in
your test files.