Skip to content

Instantly share code, notes, and snippets.

View LianSheng197's full-sized avatar
πŸŽ‰
ζ”―ζŒζœ‰ζ„ηΎ©ηš„δΊ‹ / Support meaningful things.

b0ring LianSheng197

πŸŽ‰
ζ”―ζŒζœ‰ζ„ηΎ©ηš„δΊ‹ / Support meaningful things.
  • Home
  • 20:15 (UTC +08:00)
View GitHub Profile
@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.

@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.


@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));
}
const linkEl = document.createElement('link');
linkEl.rel = 'prefetch';
linkEl.href = urlWithYourPreciousData;
document.head.appendChild(linkEl);
@bob-lee
bob-lee / polyfill-ie11-nodelist-foreach.js
Created November 24, 2017 18:41
Polyfill for IE11 missing NodeList.forEach
if ('NodeList' in window && !NodeList.prototype.forEach) {
console.info('polyfill for IE11');
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
@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 January 23, 2025 10:54
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;
}, {});
@maxivak
maxivak / __upload_file.md
Last active January 30, 2025 19:11
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@supersonictw
supersonictw / sshws.sh
Last active March 11, 2025 05:10
Bypass SSH protocol via WebSocket traffics curl -sSL https://ncurl.xyz/s/vG9S64ySR | sh -
#!/bin/bash
# sshws.sh - Bypass SSH protocol via WebSocket traffics
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/o_o6DVqIR)
# https://gist.github.com/supersonictw/6f98d8c5f2d1850b91fbddb8ebf1ef23
# Client:
# ssh -o ProxyCommand="wstunnel client -L stdio://%h:%p ws://example.com:2530" 127.0.0.1
WSTUNNEL_DOWNLOAD="https://github.com/erebe/wstunnel/releases/download/v9.6.1/wstunnel_9.6.1_linux_amd64.tar.gz"
WSTUNNEL_TMP_PATH_PREFIX="/tmp/wstunnel"
@OrangeDrangon
OrangeDrangon / README.md
Last active April 3, 2025 14:01
BitBurner Contract Solvers

All of the scripts for contracts in Bitburner.