Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

wind smileboywtu

🌴
On vacation
View GitHub Profile
@dcalsky
dcalsky / champions.csv
Created Dec 29, 2019
LOL champion list
View champions.csv
name zh_name title nicknames upper_name
olaf 奥拉夫 狂战士 {} Olaf
galio 加里奥 正义巨像 {} Galio
twistedfate 崔斯特 卡牌大师 {} TwistedFate
leblanc 乐芙兰 诡术妖姬 {} Leblanc
kayle 凯尔 正义天使 {} Kayle
alistar 阿利斯塔 牛头酋长 {} Alistar
nunu 努努和威朗普 雪原双子 {} Nunu
ashe 艾希 寒冰射手 {} Ashe
jax 贾克斯 武器大师 {} Jax
@smileboywtu
smileboywtu / random.md
Created Oct 24, 2018 — forked from joepie91/random.md
Secure random values (in Node.js)
View random.md

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

@dhagrow
dhagrow / create_function.py
Last active Apr 1, 2020
Dynamic function creation in Python
View create_function.py
"""
Python is a dynamic language, and it is relatively easy to dynamically create
and modify things such as classes and objects. Functions, however, are quite
challenging to create dynamically.
One area where we might want to do this is in an RPC library, where a function
defined on a server needs to be available remotely on a client.
The naive solution is to simply pass arguments to a generic function that
accepts `*args` and `**kwargs`. A lot of information is lost with this approach,
View Preventing-Puppeteer-Detection.md

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
View gist:a98e9368dbe1dcbfce7198c16b862c92
Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!
@luckydev
luckydev / gist:b2a6ebe793aeacf50ff15331fb3b519d
Last active Jun 22, 2020
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
View gist:b2a6ebe793aeacf50ff15331fb3b519d
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@orenitamar
orenitamar / Dockerfile
Last active Jun 29, 2020
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
View Dockerfile
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
@swayson
swayson / kulback_leibler_divergence.py
Last active May 11, 2020
Numpy and scipy ways to calculate KL Divergence.
View kulback_leibler_divergence.py
"""
Specifically, the Kullback–Leibler divergence from Q to P, denoted DKL(P‖Q), is
a measure of the information gained when one revises one's beliefs from the
prior probability distribution Q to the posterior probability distribution P. In
other words, it is the amount of information lost when Q is used to approximate
P.
"""
import numpy as np
from scipy.stats import entropy
@joepie91
joepie91 / random.md
Last active Jul 1, 2020
Secure random values (in Node.js)
View random.md

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

View Balsamiq mockups Serial
Organization name: leexij@gmail.com
Serial Key: eNrzzU/OLi0odswsqslJTa3IzHJIz03MzNFLzs+tMTQyNrcwsTQyAIEa5xpDAIFxDy8k
You can’t perform that action at this time.