Skip to content

Instantly share code, notes, and snippets.

lynt-smitka / fbclid-nginx.conf
Last active March 31, 2023 01:54
Remove fbclid argument from the URL in Nginx
View fbclid-nginx.conf
http {
# redirect map in http block - remove fbclid argument from the end
map $request_uri $redirect_fbclid {
"~^(.*?)([?&]fbclid=[a-zA-Z0-9_-]+)$" $1;
jimmywarting /
Last active May 26, 2023 03:24
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
rmhrisk / WebCrypto
Last active July 12, 2019 07:42
WebCrypto Support as of May 4th 2017
View WebCrypto

Edge image

Safari image

Chrome image


milo / fid-remove.js
Created April 20, 2017 12:46
Flash message _fid parameter remove.
View fid-remove.js
(function (w, timeout) {
setTimeout(function () {
var url = w.location.toString();
if (w.history && w.history.replaceState && url.indexOf('_fid=') !== -1) {
w.history.replaceState({}, null, /[?&]_fid=[^&]+$/.test(url)
? url.replace(/[?&]_fid=[^&]+/, '')
: url.replace(/([?&])_fid=[^&]+&/, '$1')
}, timeout || 2000);
kripken / hello_world.c
Last active April 20, 2023 12:13
Standalone WebAssembly Example
View hello_world.c
int doubler(int x) {
return 2 * x;
fdcore / pearson_correlation.php
Last active December 29, 2021 20:26
Php simple pearson correlation Function
View pearson_correlation.php
function pearson_correlation($x,$y){
if(count($x)!==count($y)){return -1;}
View hashCode.js
String.prototype.hashCode = function() {
var hash = 0, i, chr, len;
if (this.length === 0) return hash;
for (i = 0, len = this.length; i < len; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
return hash;
dg / ssl.conf
Created December 14, 2015 21:37
Redirect to HTTPS for all except Windows XP
View ssl.conf
server {
listen 443 ssl;
listen 80;
if ($server_port = 80) {
set $xp A;
tim545 /
Last active August 11, 2019 14:51
The most evil character in Unicode

'Zero Width Space' character

I had some trouble with this character in a client project, it was hidden inside a configuration string which is validated in the clients API. It's basically invisible, literally a space character with zero width, it could not be seen but it was breaking at the API because it would not validate, causing problems with hundreds of user accounts.

The Unicode value of this character is U+200B, and it's evil, very evil. Lying in wait to break your applications while leaving no sign of it's presence...

It also has some friends, check the answer of this Stack Overflow question

In my project, it was one of my colleuges who managed to find the character, he re-copied the string into the code and Git showed that the line had been changed, even though all the Git GUI's didn't actually show any difference. He ran git diff in the command line and this did show the Unicode character being deleted, that's somet

mandiwise / Update remote repo
Last active June 7, 2023 08:25
Transfer repo from Bitbucket to Github
View Update remote repo
// Reference:
// See also:
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin
$ git push origin master
$ git remote rm bitbucket