Skip to content

Instantly share code, notes, and snippets.

View FlintSable's full-sized avatar
:octocat:

Nicholas Noochla-or FlintSable

:octocat:
View GitHub Profile
# list the files and file sizes in current directory
du -h --max-depth=1
# list the files and file sizes in a specific directory
du -h --max-depth=1 /usr
# swap space
swapon -s
# Listing all the partitions on the hard disk and their mount points by using the mount command.
:: compile and rename to hello
g++ hello.cpp -o hello
g++ -Wall -std=c++14 hello.cpp -o hello
:: execute the compiled code
./hello
@FlintSable
FlintSable / ArrayMethodsParagraph.js
Last active November 26, 2018 19:18
Javascript tricks
let secretMessage = ["Learning", "isn't", "about", "what", "you", "get", "easily", "the", "first", "time,", "it's", "about", "what", "you", "can", "figure", "out.", "-2015,", "Chris", "Pine,", "Learn", "JavaScript"];
secretMessage.pop();
secretMessage.push('to', 'program');
secretMessage[6] = 'right';
secretMessage.shift();
secretMessage.unshift('Programming');
secretMessage.splice(6, 4, 'know');
console.log(secretMessage.join(" "));
# list the updates
Softwareupdate -l
# Install a specific update by name, note the space after the hyphen is needed
sudo softwareupdate -i "macOS Mojave 10.14.6 Supplemental Update 2- "
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href='//fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
<title>AJAX with JavaScript</title>
<script>
// create the http request object
var xhr = new XMLHttpRequest();
font-family: Helvetica, Arial, Sans-Serif
text-decoration: underline;
text-transform: uppercase;
text-align: center, left, right;
font-size: 60px;
@FlintSable
FlintSable / Components
Last active October 4, 2017 03:30
Components
<Link to={{
pathname: '/cources',
search: '?sort=name',
hash: '#the-hash',
state: { fromDashboard: true }
}}>
Courses
</Link>
@FlintSable
FlintSable / homebrew
Last active September 22, 2017 02:30
Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew help
@FlintSable
FlintSable / CheckAdmin.ps1
Last active August 19, 2021 04:08
network share navigation
# Returns tr
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
psExec \\\\WS886 cmd
psExec \\WS886 cmd
psExec '\\WS886' cmd
https://community.spiceworks.com/how_to/78664-remove-local-printer-on-a-remote-machine