Skip to content

Instantly share code, notes, and snippets.

View ronsims2's full-sized avatar
πŸ€
Ballin'

Ron Sims II ronsims2

πŸ€
Ballin'
View GitHub Profile
@ronsims2
ronsims2 / Maths.js
Created September 25, 2019 00:03
My Math library to help my daughter with her homework.
export const roundWholeNumber = (_num, _places) => {
const num = String(_num)
const places = String(_places)
if (isNaN(parseInt(num)) || isNaN(parseInt(places))) {
return
}
if (places.length > num.length) {
return
@ronsims2
ronsims2 / sftp_mv.sh
Created May 31, 2019 19:52
Move files using Bash and SFTP
# create a heredoc of the command you want to run, run and assign outout to a variable
getfiles=`sftp [email protected] <<GETF
ls
bye
GETF`
# Execute command and filter output, quote output to preserve new lines, this assumes all files desired are prefixed foobar_
filelist=`echo "$getfiles"|grep 'foobar_'`
(
@ronsims2
ronsims2 / README.md
Last active October 14, 2023 12:34
A script that will confirm if a specified IPA file was signed with the specified certificate.

Verify an IPA's Signing Certificate

Example :

python ipa_cert_checker.py /Users/janedoe/Documents/Foobar.ipa /Users/janedoe/Documents/barfoo.cer

If any matching certs are found, the script will print something similar to:

Certificate (1) beginning: XCVBNM... matches the specified certificate: /Users/janedoe/Documents/barfoo.cer

# image to base 64
from PIL import Image
import numpy as np
image = Image.open('~/some.image.png')
image_array = np.array(image)
image_data = base64.binascii.b2a_base64(image_array).decode('ascii')
@ronsims2
ronsims2 / data.json
Last active October 6, 2018 14:26
Ryan Might Be Drake
{
"name": "Ryan might be Drake",
"description": "He could be you be the judge.",
"data": [{
"title": "I Think My Brother Might be Drake",
"description": "This conspiracy theory may seem far fetched, but I have 30 reasons (of varying credibility) for thinking that my brother might be Drake.",
"image": "default",
"comment": "A studio portrait of Ryan as a kid.",
"hideNumber": true
}, {
{
"id": 42,
"name": "Stereotypes",
"description": "A bingo game for TV stereotypes",
"boardSize": 9,
"data": [
{
"name": "Alpha",
"description": "Buddy Love",
"emoji": "πŸ˜€",
@ronsims2
ronsims2 / algebra.py
Last active May 13, 2018 19:51
Calculate pay the pythonic way!
# in algebra we learn y = m * x + b
# In python that would look like this
import math
def linear(m, x, b):
return m * x + b
# A function takes inputs, processes them and returns a a single item.
# This single item can be a numeric, a string, or something liek a dictionary or tuple
# in some advanced cases a function returns another function (we aint' goin' there)!
@ronsims2
ronsims2 / array_chunk.js
Created February 5, 2018 20:21 — forked from subimage/array_chunk.js
Javascript array chunk
// Splits an array into equal sized chunks
Array.prototype.chunk = function(pieces) {
pieces = pieces || 2;
var len = this.length;
var mid = (len/pieces);
var chunks = [];
var start = 0;
for(var i=0;i<pieces;i++) {
var last = start+mid;
if (!len%pieces >= i) {
function remindify() {
var ss = SpreadsheetApp.openById('my-google-sheet-id');
var sheet = ss.getSheets()[0];
var cols = sheet.getMaxColumns();
var rows = sheet.getMaxRows();
var range = sheet.getRange(1,1, rows, cols);
var values = range.getValues();
var to = '[email protected]';
var now = new Date();
var A_DAY_MS = 43200000;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
<script>
window.orgMapJustice = {};
if (navigator.userAgent.match(/MSIE/)) {
window.orgMapJustice.isIE = true;
}