Skip to content

Instantly share code, notes, and snippets.

View jaredyam's full-sized avatar
👫
Falling in love with Wu.

jaredyam

👫
Falling in love with Wu.
  • Beijing, China
View GitHub Profile
@jonluca
jonluca / requests.py
Created June 15, 2021 04:06
Fast AsyncIO HTTP requests
import http.cookies
http.cookies._is_legal_key = lambda _: True
import asyncio
import aiohttp
import nest_asyncio
import time
nest_asyncio.apply()
async def gather_with_concurrency(n, *tasks):
semaphore = asyncio.Semaphore(n)
@prologic
prologic / LearnGoIn5mins.md
Last active May 5, 2024 17:05
Learn Go in ~5mins
#!/usr/bin/env python3
# Recursively generate index.html files for
# all subdirectories in a directory tree
##########################################################################
## ❗️❗️❗️ WARNING: This version is outdated and unmaintained!
## For an up-to-date version with cleaner CSS styling see:
## https://gist.github.com/glowinthedark/625eb4caeca12c5aa52778a3b4b0adb4
##########################################################################
@mrnabati
mrnabati / gitSolutions.md
Last active September 21, 2023 22:43
Common Git problems (and solutions!)

Working with submodules in your repository

  • Create the submodule:

    git submodule add -b master <git@github.com:MYSUBMODULE.git> <path/to/MYSUBMODULE>

    This creates the submodule and makes it track submodule's master branch. You can change the branch name if you want to track a different branch.

  • Change some settings. In the parent repo:

    # make it so that git status will include changes to submodules.
@endolith
endolith / DFT_ANN.py
Last active April 29, 2024 11:20
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import matplotlib.pyplot as plt
N = 32
batch = 10000
@josantonius
josantonius / language-codes.json
Last active January 10, 2024 17:16
List of 217 language codes (ISO 639-1)
{
"aa": "Afar",
"ab": "Abkhazian",
"af": "Afrikaans",
"am": "Amharic",
"ar": "Arabic",
"ar-ae": "Arabic (U.A.E.)",
"ar-bh": "Arabic (Bahrain)",
"ar-dz": "Arabic (Algeria)",
"ar-eg": "Arabic (Egypt)",
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@kazad
kazad / fourier.html
Created June 25, 2014 19:00
BetterExplained Fourier Example
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script src="//ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
<!--
TODO:
@unruthless
unruthless / CSS for <sup> and <sub>
Created May 26, 2010 01:31
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position