Skip to content

Instantly share code, notes, and snippets.

View pleabargain's full-sized avatar
🏠
office

Dennis pleabargain

🏠
office
View GitHub Profile
@pleabargain
pleabargain / factor.js
Last active February 19, 2017 14:27
factor a number in js with simple error catching
function factorial(num)
{
// If the number is less than 0, reject it.
if (num < 0) {
//error message to user
console.log('use a number above 1');
return -1;
}
@pleabargain
pleabargain / werewolf.js
Created February 25, 2017 10:29
if else reference
var moonPhase = 'full';
var foggyNight = false;
if (moonPhase === 'full' || foggyNight === true){
console.log('Howwwwwlll!!');
}
else if (moonPhase === 'mostly new'){
console.log('Back on two feet');
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pleabargain
pleabargain / segfaultinjupyterlab.ipynb
Created May 17, 2018 14:10
chasing a seg fault bug in jupyter lab
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pleabargain
pleabargain / recordscreenshot.json
Created October 6, 2018 10:08
kantu test macro
{
"CreationDate": "2018-10-6",
"Commands": [
{
"Command": "open",
"Target": "https://forum.a9t9.com/",
"Value": ""
},
{
"Command": "clickAt",
@pleabargain
pleabargain / IMscript-png.sh
Created October 11, 2018 14:51
this will write the file name on to the png image
for img in *.png; do
width=$(identify -format %W ${img})
width=$(( ${width} * 9 / 10 ))
convert \
-background '#0008' \
-gravity center \
-fill white \
-size ${width}x100 \
@pleabargain
pleabargain / extract iban data.html
Last active October 13, 2018 08:14
Kantu macro extracting data and saving as CSV
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>testCSVsave</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
@pleabargain
pleabargain / python_choose_your_story.py
Created December 14, 2020 09:52
super simple text adventure
print('''
*******************************************************************************
| | | |
_________|________________.=""_;=.______________|_____________________|_______
| | ,-"_,="" `"=.| |
|___________________|__"=._o`"-._ `"=.______________|___________________
| `"=._o`"=._ _`"=._ |
_________|_____________________:=._o "=._."_.-="'"=.__________________|_______
| | __.--" , ; `"=._o." ,-"""-._ ". |
|___________________|_._" ,. .` ` `` , `"-._"-._ ". '__|___________________
# -*- coding: utf-8 -*-
# @author: Peter Lamut
import argparse
import os
import shutil
N = 10 # the number of files in seach subfolder folder