Skip to content

Instantly share code, notes, and snippets.

@davecra
davecra / detectMimeType.js
Created December 31, 2022 02:53
A JavaScript function to detect the Media/Mime Type for a base64 string
/**
* Returns the data type based on the base64 string
* @param {String} base64String
* @param {String} fileName
* @returns {String}
*/
detectMimeType(base64String, fileName) {
var ext = fileName.substring(fileName.lastIndexOf(".") + 1);
if (ext === undefined || ext === null || ext === "") ext = "bin";
ext = ext.toLowerCase();
@qti3e
qti3e / README.md
Last active July 21, 2025 22:26
List of file signatures and mime types based on file extensions
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active August 18, 2025 17:06
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rauchg
rauchg / README.md
Last active April 13, 2025 04:29
require-from-twitter
@prabeengiri
prabeengiri / native_app_launcher.js
Last active July 3, 2025 00:54
Native App Launcher (Works in ios9)
// NativeAppLauncher.
// Copied from bartt.me/openapp
var NativeAppLauncher = (function () {
var IOS_VERSION_RE = /OS\s+(\d)_/;
var timers = [];
var userAgent = window.navigator.userAgent;
var isAndroid = function () {
return /Android/.test(userAgent);
};
var isIOS = function () {
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active August 15, 2025 00:48
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@jo
jo / js-crypto-libraries.md
Last active May 21, 2025 02:55
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@Stanback
Stanback / nginx.conf
Last active March 30, 2025 03:57 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@ksafranski
ksafranski / Common-Currency.json
Last active July 31, 2025 14:56
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},