Skip to content

Instantly share code, notes, and snippets.

🎓
Graduated from UMD!

Kevin Mark kmark

🎓
Graduated from UMD!
Block or report user

Report or block kmark

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View flexfix.sh
#!/bin/sh
# Rebuilds flex to avoid the following:
# flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data:
# Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
# Aborted (core dumped)
# --
# Run this in your repo root after a repo sync
# Tested on Ubuntu 18.04.02 LTS
@kmark
kmark / pi_bashrc.sh
Last active Jul 22, 2019
Modified RetroPie bashrc for general Raspberry Pi use.
View pi_bashrc.sh
# MODIFIED RETROPIE PROFILE START
# Source: https://github.com/RetroPie/RetroPie-Setup/blob/cc1f125c8f79d68b2d9393d21d992a7440b09085/scriptmodules/supplementary/bashwelcometweak.sh
function getIPAddress() {
local ip_route
ip_route=$(ip -4 route get 8.8.8.8 2>/dev/null)
if [[ -z "$ip_route" ]]; then
ip_route=$(ip -6 route get 2001:4860:4860::8888 2>/dev/null)
fi
[[ -n "$ip_route" ]] && grep -oP "src \K[^\s]+" <<< "$ip_route"
@kmark
kmark / mtrandout.php
Last active Jan 30, 2019
Does about 15 MiB/s on my machine
View mtrandout.php
#!/usr/bin/env php
<?php
mt_srand(random_int(PHP_INT_MIN, PHP_INT_MAX));
while (true) {
$a = [];
for ($i = 0; $i < 10000; $i++) {
$a[] = mt_rand_short();
}
View ScreencastDotComDownloader.php
#!/usr/bin/env php
<?php
/*
* Screencast.com Account Media Downloader
*
* Copyright 2018 Kevin Mark
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
View keybase.md

Keybase proof

I hereby claim:

  • I am kmark on github.
  • I am kmark (https://keybase.io/kmark) on keybase.
  • I have a public key ASD87DuZhJZvhUxayBp3iBYimHH-qy9qOdbY6yIhnFt3Wgo

To claim this, I am signing this object:

View jerk.rs
// https://www.reddit.com/r/programmingcirclejerk/comments/8f7gjg/psa_there_are_over_1000_people_in_the_us_named/dy1c4ey/
fn main() {
const JERK: &str = "INFINITY";
fn exaggerate(mut acc: String, ch: char) -> String {
acc.push(ch);
acc.push(' ');
acc
}
View jerk.lisp
; https://www.reddit.com/r/programmingcirclejerk/comments/8ebz88/the_major_difference_between_java_and_golang_is/dxuq7l0/
(defun square-val (x y str len)
(cond
((eql y 0) (elt str x))
((eql x 0) (elt str y))
((and (eql x len) (eql y len)) (elt str 0))
((eql y len) (elt str (- len x)))
((eql x len) (elt str (- len y)))
(t #\Space)))
View 0001-Allow-entire-file-to-match-or-first-10241-bytes.patch
From 6a13d2435af223a6164734b3e9255d686578e5c2 Mon Sep 17 00:00:00 2001
From: Kevin Mark <kmark937@gmail.com>
Date: Sat, 8 Jul 2017 19:45:21 -0400
Subject: [PATCH] Allow entire file to match or first 10241 bytes
---
test/test_download.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/test_download.py b/test/test_download.py
@kmark
kmark / extractMotionPhotos.sh
Last active Jan 26, 2019
Samsung Galaxy Motion Photo extraction tool
View extractMotionPhotos.sh
#!/bin/bash
# Copyright 2017 Kevin Mark
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
View BreathingLEDNonblocking.ino
/* Non-blocking Breathing LED
* Kevin Mark, 2017
* https://kmark.io
*
* Adapted from:
* Breathing sleep LED, like on a Mac.
* Jeremy Saglimbeni 2011
* http://thecustomgeek.com/2011/06/17/breathing-sleep-led/
*/
You can’t perform that action at this time.