Skip to content

Instantly share code, notes, and snippets.

View kebman's full-sized avatar
Playing Ponkatris

kebman kebman

Playing Ponkatris
View GitHub Profile
@kebman
kebman / gpsConverter.html
Created March 31, 2018 20:48
Converts Google Maps coordinates for use with Adobe Bridge image metadata
<!DOCTYPE html>
<html>
<head>
<title>Google Maps GPS Coordinate to Adobe Bridge - kebman.com</title>
<meta charset="utf-8">
<style type="text/css">
#form {
background-color: MistyRose;
padding: 0.5em;
}
@kebman
kebman / hashfiles.py
Last active February 15, 2018 22:30
A small Python script meant to find file duplicates by listing hashes, file (birth) creation times and file sizes. Copy and edit as you wish.
#!/usr/bin/env python2
import os
import hashlib
import datetime
# Warning: Recursive program. If ran or set from root, it will list ALL THE FILES on the drive. Hit Ctrl+C if you get bored.
path = "."
# UX (and OS X) spesific path names
homedir = os.path.expanduser('~')
@kebman
kebman / getBtcUsd.js
Last active October 25, 2017 05:32
Get Bitcoin BTC/USD quotes from Bitstamp.net using Node.js
/*
* Small Node.js script that gets BTC/USD quotes from www.bitstamp.net
* from https://www.bitstamp.net/api/v2/ticker/BTCUSD/
*/
const https = require('https'); // because the URL is https
const quoteOptions = {
host: 'www.bitstamp.net',
port: 443, // because https default
@kebman
kebman / primitiveRootModulo.js
Created August 10, 2017 02:26
Find All Primitive Root Modulo of a Prime Number
/*
* Equation for finding the Primitive Root Modulo n:
* cn^n mod p
* for n = 1 to n = p-1
* This program is a little heavy on the counting, though it seems to work with the current set of Prime Numbers...
*/
// a few prime numbers for testing:
const primeNumbers = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281];
// console.log(primeNumbers.length); // check size
@kebman
kebman / ff.sh
Created February 12, 2017 22:43
Examples on how to manipulate Files and Folders with Bash
#!/bin/bash
# ff.sh ver 1.0
# Manipulate Files and Folders with Bash…
# minimal check of correct amount of input arguments
if [[ $# -eq 0 ]] ; then
echo "Use a file with a valid file extension, then do:"
echo "bash ff.sh [testfile.ext]"
exit 0
fi
@kebman
kebman / .bash_profile
Last active December 24, 2016 03:41
The bash profile for my Terminal in Mac OS X Sierra
export PATH=/usr/local/mysql/bin:$PATH
export PS1="\u \\$ \[$(tput sgr0)\]"
alias nj='cd /Users/username/Dropbox/node'
alias home='cd ~'
@kebman
kebman / standardDeviation.html
Last active March 23, 2016 13:12
Tutorial on how to get the Standard Deviation of a set of numbers using JavaScript
<!DOCTYPE html>
<html>
<head>
<title>Standard Deviation</title>
<meta charset="utf-8">
<style type="text/css"></style>
</head>
<body>
<header>
<h1>Standard Deviation</h1>
@kebman
kebman / dragbox.html
Last active February 17, 2016 23:01
Example of a freely draggable box element made with HTML5 and JavaScript
<!DOCTYPE html>
<html>
<head>
<title>Movable Element</title>
<meta charset="utf-8">
<style type="text/css">
#testBox {
/* define shape and colour */
width: 50px; height: 50px;
background-color: #ddd;
@kebman
kebman / callback.html
Created February 2, 2016 14:47
JavaScript Callback Example
<!DOCTYPE html>
<html>
<head>
<title>Example of using callbacks in JavaScript</title>
<meta charset="utf-8" />
<style type="text/css"></style>
</head>
<body>
<header>
<h1>Simulation of delayed callback functionality</h1>
@kebman
kebman / tictoc.html
Created December 23, 2015 02:38
Simple Tic Toc in HTML5
<!DOCTYPE html>
<html>
<head>
<title>Tic Toc</title>
<meta charset="utf-8">
</head>
<body>
<header>
<h1>Tic Toc</h1>
</header>