Skip to content

Instantly share code, notes, and snippets.

View daxxog's full-sized avatar

David Volm daxxog

View GitHub Profile
#!/bin/sh
#curl -L https://tinyurl.com/dd-benchmark-sh | sh
echo "dd-benchmark.sh" > disk-benchmark.log.out
echo $(date) >> disk-benchmark.log.out
echo "-----------------------------" >> disk-benchmark.log.out
echo >> disk-benchmark.log.out
echo "-----Testing write speed-----" >> disk-benchmark.log.out
dd if=/dev/zero bs=1024k of=tstfile count=1024 2>> disk-benchmark.log.out
@daxxog
daxxog / intel-mac-nvram-fix.sh
Created March 19, 2020 12:28
IntelAccelerator prodding blockFenceInterrupt
#!/bin/bash
nvram 8be4df61-93ca-11d2-aa0d-00e098032b8c:epid_provisioned=%01%00%00%00
@daxxog
daxxog / case.js
Created February 23, 2020 00:53
generator for palindrome case statements
const c4se = function(n) {
const varname = 'string_x';
var buildCase = '';
console.log('case ' + n + ':');
for(var i = 0; i<~~(n/2); i++) {
buildCase += '(string_x[' + i + '] === ' + 'string_x[' + (n - i - 1) + '])';
}
>B
>b
>
>CE
>c
>E
>ABcDE
>E
>ABCDe
>AbCDE
if B then
checkpoint
fi
if ~B then
checkpoint
fi
if A|B then
checkpoint
if C then
if E then
@daxxog
daxxog / dynamically-load-jquery-library-javascript.js
Created January 10, 2020 17:07
Load jQuery library using plain JavaScript (With callback)
//- https://www.sitepoint.com/dynamically-load-jquery-library-javascript/
//- Load jQuery library using plain JavaScript (With callback)
//- ---------------------------------------------------------------------
(function () {
function loadScript(url, callback) {
var script = document.createElement("script")
script.type = "text/javascript";
@daxxog
daxxog / rm-hidden.sh
Created January 3, 2020 12:33
remove hidden files in the current directory recursively
find "$(pwd)" -type f -name ".*" -delete
@daxxog
daxxog / long-div.py
Created December 11, 2019 16:24
Long division python script I made for my kid's math homework.
# long-div.py
# (c) 2019 David Volm (daXXog) <>< + + + ><>
# ___________________________________________
firstNumber=input('whats the first number? \n')
secondNumber=input('whats the second number? \n')
def floorDiv():
thinkFloor = str(int(secondNumber // firstNumber))
lenDiff = len(str(secondNumber)) - len(thinkFloor)
@daxxog
daxxog / problem-8-1.py
Created December 9, 2019 01:36
Fix the 5 syntax errors in the code below to print a countdown of the numbers from 10 to 0.
counter = 10
while counter >= 0:
print(counter)
counter = counter - 1
print('David Volm')
@daxxog
daxxog / prims.js
Last active December 5, 2019 20:27
Prims algo in JS
// David's prims (JavaScript)
// rough hacked together version !
//
// (c) 2019 daXXog <>< + + + ><>
// ------------------------------------------
// [[][][]].flatten prototype
//- https://stackoverflow.com/a/19191529
Array.prototype.flatten = function() {
var arr = this,