Skip to content

Instantly share code, notes, and snippets.

View claudianus's full-sized avatar
๐Ÿ 
Working from home

Claudianus Mamertus claudianus

๐Ÿ 
Working from home
  • Modumaru
  • South Korea
  • 04:38 (UTC +09:00)
View GitHub Profile
@banksean
banksean / mersenne-twister.js
Created February 10, 2010 16:24
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@kuleszaj
kuleszaj / gist:1911022
Created February 25, 2012 21:48
Simple nginx reverse proxy with extra headers.
server {
listen 1.2.3.4:80;
server_name railsapp.example.com;
location / {
proxy_set_header Host $host;
# So the original HTTP Host header is preserved
proxy_set_header X-Real-IP $remote_addr;
# The IP address of the client (which might be a proxy itself)
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# The IP address in the HTTP X-Forwarded-For header (which would be the 'origin' client).
@rxaviers
rxaviers / gist:7360908
Last active June 10, 2025 15:38
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@denji
denji / nginx-tuning.md
Last active June 7, 2025 14:57
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@kijin
kijin / rsa_encrypt.php
Created January 23, 2014 04:55
PHP์—์„œ RSA ๊ฐœ์ธํ‚ค/๊ณต๊ฐœํ‚ค ์กฐํ•ฉ์„ ์‚ฌ์šฉํ•˜์—ฌ ์„œ๋ฒ„์— ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ €์žฅํ•  ํ•„์š” ์—†์ด ๋ฌธ์ž์—ด์„ ์•”ํ˜ธํ™”ํ•˜๋Š” ๋ฒ•
<?php
// ๋น„๋Œ€์นญ ์•Œ๊ณ ๋ฆฌ๋“ฌ์ธ RSA๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฌธ์ž์—ด์„ ์•”ํ˜ธํ™”ํ•˜๋Š” ๋ฒ•.
// ๊ฐœ์ธํ‚ค ๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” ์•”ํ˜ธํ™”ํ•  ๋•Œ๋Š” ํ•„์š”์—†๊ณ  ๋ณตํ˜ธํ™”ํ•  ๋•Œ๋งŒ ์ž…๋ ฅํ•˜๋ฉด ๋˜๋ฏ€๋กœ
// ์„œ๋ฒ„์— ์ €์žฅํ•  ํ•„์š” ์—†์ด ๊ทธ๋•Œ๊ทธ๋•Œ ๊ด€๋ฆฌ์ž๊ฐ€ ์ž…๋ ฅํ•˜๋„๋ก ํ•ด๋„ ๋œ๋‹ค.
// PHP 5.2 ์ด์ƒ, openssl ๋ชจ๋“ˆ์ด ํ•„์š”ํ•˜๋‹ค.
// RSA ๊ฐœ์ธํ‚ค, ๊ณต๊ฐœํ‚ค ์กฐํ•ฉ์„ ์ƒ์„ฑํ•œ๋‹ค.
// ํ‚ค ์ƒ์„ฑ์—๋Š” ์‹œ๊ฐ„์ด ๋งŽ์ด ๊ฑธ๋ฆฌ๋ฏ€๋กœ, ํ•œ ๋ฒˆ๋งŒ ์ƒ์„ฑํ•˜์—ฌ ์ €์žฅํ•ด ๋‘๊ณ  ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.
// ๋‹จ, ๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” ๊ฐœ์ธํ‚ค๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋งˆ๋‹ค ํ•„์š”ํ•˜๋‹ค.
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active June 9, 2025 17:28
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@define-private-public
define-private-public / HttpServer.cs
Last active May 27, 2025 16:03
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@NaxAlpha
NaxAlpha / HookFx.cs
Last active October 24, 2024 12:53
Windows API Hook with C#
using System;
using System.Runtime.InteropServices;
public class FxHook:IDisposable {
const int nBytes = 5;
IntPtr addr;
Protection old;
byte[] src = new byte[5];
@jagrosh
jagrosh / WebhookTutorial.md
Last active May 8, 2025 00:13
Simple Webhook Tutorial (Twitter -> Discord)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel

Step 1 - Register on Zapier

  1. Go to https://zapier.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active June 9, 2025 17:32
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings