Skip to content

Instantly share code, notes, and snippets.

View NullDev's full-sized avatar
:octocat:
(◕‿◕)

NullDev // Chris NullDev

:octocat:
(◕‿◕)
View GitHub Profile
@NullDev
NullDev / colors.sh
Created November 15, 2017 13:10
Bash/Shell Colors
# Regular Colors
\[\033[0;30m\] # Black
\[\033[0;31m\] # Red
\[\033[0;32m\] # Green
\[\033[0;33m\] # Yellow
\[\033[0;34m\] # Blue
\[\033[0;35m\] # Purple
\[\033[0;36m\] # Cyan
\[\033[0;37m\] # White
@NullDev
NullDev / Stackoverflow-Snippets.md
Created November 27, 2017 20:39
Useful Stackoverflow formatting snippets

Button

Code:

<kbd>**[Live Demo](http://jsfiddle.net/)**</kbd>

Preview:

Screenshot

@NullDev
NullDev / jsfiddle_DOM.md
Last active December 14, 2017 08:35
jsfiddle console.log to DOM

HTML:

<div id="t"></div>

JS:

var console={log:function(t){document.getElementById("t").innerHTML+=t+""}};
@NullDev
NullDev / decoder.js
Last active April 14, 2018 16:13
Decode Syrapt0r's "my final note.txt" file by bitshifting it. See: http://code17.wikia.com
"use strict";
let path = require("path");
let fs = require("fs");
////////////////////////////////
//----------------------------//
// Copyright (c) 2018 NullDev //
//----------------------------//
////////////////////////////////
@NullDev
NullDev / pagination.md
Last active April 25, 2018 12:59
Pagination Example

JS:

/* -- Pagination -- */
var currPage = 1;
var numsPerPage = 6;

$(document).ready(function(){
    $("div.content-single").hide();
    $("div.content-single:lt(" + numsPerPage + ")").show();
@NullDev
NullDev / vc-fix.md
Last active April 27, 2018 12:52
Visual Composer iPad height fix

This is a (temporary fix) for visual composer messing up heights of grid elements on iPads.
Basically, visualcomposer just parses the device width and height very sloppy.
this results in a height property like this:

element {
    height: 314x301;
}
@NullDev
NullDev / ChainFunction.js
Last active November 15, 2018 14:58
Global Chain function example with prototyping
Function.prototype.test = function(x){
var arg1 = this();
var arg2 = x;
console.log(
"Arg1: " + arg1 +
"\nArg2: " + arg2
);
}
@NullDev
NullDev / logger.js
Created September 23, 2019 16:43
NodeJS Logger with StackTrace function
"use strict";
/**
* Formats the current time
*
* @returns {string} Time
*/
let getDate = function(){
const date = new Date();
let hourData = date.getHours();
@NullDev
NullDev / README.md
Created January 16, 2020 14:42
Check if a windows binary (.exe) was compiled for 32 Bit or 64 Bit (useful for wine)

About

This script checks whether a windows binary (.exe file) was compiled ro 32 Bit or 64 Bit. If you mess around with Wine / PlayOnLinux a lot, this could be useful.

Usage

Making the script executable

@NullDev
NullDev / random_string.js
Last active March 9, 2020 15:39
ES6 way of generating a random string with variable length
let getRandomString = (length) => [...Array(length)].map(() => Math.random().toString(36)[2]).join("");
let str = getRandomString(10);
// -> 225n9b53x6
// ---
// Demo: https://jsfiddle.net/fku9y6sm/