Skip to content

Instantly share code, notes, and snippets.

View daneov's full-sized avatar

Daneo van Overloop daneov

View GitHub Profile

Keybase proof

I hereby claim:

  • I am daneov on github.
  • I am daneov (https://keybase.io/daneov) on keybase.
  • I have a public key ASD2EluzBrCpN-OMiE-dP63iTWAuXoeQ7JcGxp0jsz1s4Qo

To claim this, I am signing this object:

function mockWithType(contentType, httpMethod = "GET", referenceUrl = "/") {
const urlResult = baseUrl + referenceUrl
console.log("Mocked '" + urlResult + "' for " + httpMethod);
fetchMock.mock(
(url, opts) => {
return url === urlResult && opts && opts.headers && opts.headers.get('Content-Type') === contentType
},
{
number: 200,
@daneov
daneov / snippet.js
Last active January 2, 2018 13:09
Getting notified when a block is found on pool.sumokoin.ch
$('#poolLastBlockFound').on('DOMSubtreeModified', function(x) {
var blockFoundText="1 minute";
if (x.target.innerHTML.includes(blockFoundText)) {
alert('Block found!');
}
})
// OR
var elementId = "poolLastBlockFound";
@daneov
daneov / install_amd_properly.sh
Created December 22, 2017 12:38
AMD, Ubuntu and XMR-Stak
# -- Install the drivers ---
cd amdgpu-pro-17.50-511655/
sudo ./amdgpu-pro-install --opencl=legacy,rocm --headless
sudo reboot
# -- Testing to see if this works properly ---
cd /opt/amdgpu-pro/
./bin/clinfo
# -- Get a second opinion ---
@daneov
daneov / swarm_auto_connect.sh
Last active March 29, 2017 12:05
This script uses the Swarm client to auto-connect to Jenkins master who has the Swarm Plugin installed.
#!/bin/bash
# -------------------------------------------------------------
# | Extract password and username from passed parameters |
# -------------------------------------------------------------
while getopts ":u:p:" opt; do
case $opt in
u) username="$OPTARG"
;;
p) password="$OPTARG"
#!/bin/bash
randpw(){ < /dev/urandom LC_CTYPE=C tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c8; echo "";}
sendPush(){
token="$1"
curl --header "Access-Token: $token" \
--header 'Content-Type: application/json' \
--data-binary "{\"body\":\"$passwd\",\"title\":\"Cloud9 Authentication\",\"type\":\"note\"}" \
--request POST \
https://api.pushbullet.com/v2/pushes;
}