Skip to content

Instantly share code, notes, and snippets.

View fredkelly's full-sized avatar

Freddy Kelly fredkelly

View GitHub Profile
@luzhuomi
luzhuomi / pocketchip_debian10.md
Last active April 16, 2024 13:05
A tutorial to upgrade NXT pocket C.H.I.P to Debian Buster

Pocket Chip Debian 10 Upgrade Guide

The purpose of this tutorial is to walk through the required steps to upgrade NXT chip (or pocketchip) from debian jessie to debian buster.

If you would like to start your Chip from scratch, follow the steps in the Preparation section.

Preparation (Optional)

A linux host machine, recommended Ubuntu 18.04. However I managed to do it with 20.10 with some tweak.

bindkey '^R' history-incremental-pattern-search-backward
HISTSIZE=100000
SAVEHIST=100000
setopt hist_ignore_all_dups
setopt inc_append_history extendedglob share_history
. /etc/profile.d/autojump.zsh
@jefflarkin
jefflarkin / gpio.sh
Last active April 13, 2018 22:15
BASH functions for using the C.H.I.P. GPIO pins.
#!/bin/bash
#FIXME Add usage() function to improve documentation
# Enable exposure of the specified GPIO pin (0-8)
gpio_enable()
{
if [[("$1" -lt 0) || ("$1" -gt 8)]] ; then
echo "Valid pins are 0-8"
return -1;
fi

Last updated: 2015-08-11

Searching for Files

Find mp3 in a directory that are multipart album but not in CD[0-9] folder

exiftool -partofset -directory -filename -r -if '$partofset =~ /^\d\/\d$$/ and $directory =~ /(?<!\d)$$/i and $filetype eq "MP3"' .

Find images in a directory that don't have a DateTimeOriginal

@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active February 13, 2024 07:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 25, 2024 04:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@50kudos
50kudos / flashflush.sh
Last active November 3, 2019 02:03
A Bash script that lists all unused css classes in html/haml/erb files for rails project (or maybe others depending on project structure)
#!/bin/bash
cat $(find app/assets/stylesheets/ -type f) |
grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// |
while read CSS; do
if ! grep -Erqi "([^(remove|has)]?class[(:|=|[:space:]*=>[:space:]*)]*[[:space:]\W]*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then
echo $CSS >> unused.scss;
fi
done
@ololobus
ololobus / Spark+ipython_on_MacOS.md
Last active November 22, 2022 22:24
Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112

For older versions of Spark and ipython, please, see also previous version of text.

Install Java Development Kit

@xarem
xarem / README.md
Last active May 4, 2020 04:11
Upload files from context menu in OS X
  • Step 1, create Service in Automator:

Step 1

  • Step 2, set Service for files:

Step 2

  • Step 3: insert bash script (see below)
  • Step 4, save:

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).