Skip to content

Instantly share code, notes, and snippets.

View LianSheng197's full-sized avatar
🎉
支持有意義的事 / Support meaningful things.

b0ring LianSheng197

🎉
支持有意義的事 / Support meaningful things.
  • Home
  • 04:08 (UTC +08:00)
View GitHub Profile
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@nathggns
nathggns / base64url.php
Created September 21, 2013 18:34
base64url functionality for php
<?php
function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
@edokeh
edokeh / index.js
Last active July 23, 2024 14:08
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@vukicevic
vukicevic / Draw Bitmap From Int Array
Last active October 31, 2023 08:50
Generate a monochrome bitmap image in JavaScript using a byte-array. The image is generated such that every bit in the array is shown as either a black (1) or white (0) pixel.
/**
* depth: 1 - monochrome
* 4 - 4-bit grayscale
* 8 - 8-bit grayscale
* 16 - 16-bit colour
* 32 - 32-bit colour
**/
function drawArray(arr, depth) {
var offset, height, data, image;
@rendro
rendro / parsecookie.js
Last active May 4, 2024 15:38
Parse document.cookie into object
document.cookie.split(';').map(function(c) {
return c.trim().split('=').map(decodeURIComponent);
}).reduce(function(a, b) {
try {
a[b[0]] = JSON.parse(b[1]);
} catch (e) {
a[b[0]] = b[1];
}
return a;
}, {});
@dharma017
dharma017 / extract-mp3-from-swf-linux.md
Created September 14, 2015 05:18
Extract MP3 from SWF files on Linux (Ubuntu)

###Extract MP3 from SWF files on Linux (Ubuntu)

We will use a tool called swfextract contained on the package swftools, so first we will install it

sudo apt-get install swftools

Once installed first we will see wich media we can extract from our swf file.

@subfuzion
subfuzion / curl.md
Last active July 18, 2024 17:12
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@JoshCheek
JoshCheek / bash_and_ansi_escape_sequence.md
Created July 11, 2016 16:27
Explanation of a confusing line of bash code / ANSI escape sequences.
echo "\[\033[${2:-37};60m\]${1}\[\033[0m\]"

Echo is the program echo that you can run from the terminal. (eg $ echo hello world) it works here because the output of the function is being captured and put into a string.


@jimmywarting
jimmywarting / readme.md
Last active July 23, 2024 18:45
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers