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 / hitchhikers_guide.md
Created November 26, 2019 14:44
Don't Panic!

Hitchhikers guide to Developer Sanity

  • pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Delete virtual environmnet directory and install a new venv with a proper (brew installed) interpreter as the base.
@ronsims2
ronsims2 / commands.sh
Last active November 24, 2023 21:19
Command Line Fun
# XML - get a value using xmlint with xpath the @something (in this case "@string" is an attribute selector
xmllint --xpath "string(//Project/stuff/stuff/Stuff/@string)" some-data.pretty.xml | less
#Select by node index
xmllint --xpath "string(//Project/stuff/stuff[2]/Stuff/@string)" some.pretty.xml | less
# get password for MacOs keycahin assuming that the item is called foobar and the 'account' values is the same as the logged in user
MYPASSWORD=`security find-generic-password -a ${USER} -s foobar -w`
#Pretty print xml
@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 me@myhost.com <<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) {