Skip to content

Instantly share code, notes, and snippets.

@riansanderson
riansanderson / gist:af09687fb0edf0b275e881d5199b332f
Created October 9, 2016 05:28 — forked from yano3/gist:1378948
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
@riansanderson
riansanderson / arm-cortex-m details
Last active August 24, 2016 04:49
nity gritty for building software on Cortex-M
# Getting Keil (armcc) to build gcc/iar compatible libraries
--library_interface=aeabi_clib
# Soft vs Hard FP
Soft versus hard FP is about function calling conventions, and binaries compiled with softfp will simply crash when loaded into a hardfp system.
/hardfp, /softfp
Requests hardware or software floating-point linkage. This enables the procedure call standard to be specified separately from the version of the floating-point hardware available through the --fpu option. It is still possible to specify the procedure call standard by using the --fpu option, but ARM recommends that you use --apcs instead.
@riansanderson
riansanderson / gist:6c4dbd80fe9c1891f6c8
Created November 17, 2015 23:29
Setup node.js and friends
#don't install node from ubuntu packages...
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install nodejs
sudo rm /usr/bin/node /usr/sbin/node
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo ln -s /usr/bin/nodejs /usr/sbin/node
#important to install all these at the same time ...
sudo npm install -g grunt-cli bower yo generator-karma generator-angular
@riansanderson
riansanderson / gist:7283379d6717feb6e92f
Created August 4, 2015 23:56
Sensors at the command line
# change permissions for several input event devices
cat /proc/bus/input/devices | awk '/sim-/,/event/ {d=$1; if (/N:/) {split($2,n,"=")}; if(/event/) {split($2,e,"="); print e[2] "\t" n[2]; system("sudo chmod a+rw /dev/input/" e[2])}}'
# apt-get install a package without installing some dependencies
cd /tmp; mkdir some-package; cd some-package;
## download using a list of only the packages you want (note dep-C is missing here)
apt-get download some-package dependecy-a dependency-b dependecy-d
sudo dpkg --forece-all -i *.deb
# capture a screen shot over adb first works in linux, second works mac+windows
adb shell screencap -p | sed 's/\r$//' > screen.png
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
# samsung reload firmware on demand
*#2663#
# samsung test mode app
*#0*#
# switch the android tag your repo is building against
JSON=`cat $SOURCE|python -mjson.tool`
# Proccess JSON into array
PARSED=(`echo $JSON| sed -e 's/[{}]/''/g'| awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/:/ /1'| awk -F" " '{ print $2 }'`)
ctrl-[xyz] shouldn't do anything if nothing is selected
ctrl-x, [123] split windows
ctrl-x,o to switch to other window
does not startup with last session
need C/C++ indenting
switch between .h/.c[pp]
hex editor
grok cmake files
# I like this better than the official docs
http://docs.sublimetext.info/en/latest/index.html
# list of working packages
https://github.com/wbond/sublime_package_control/wiki/Sublime-Text-3-Compatible-Packages
# package control helps you get packages easier
from http://wbond.net/sublime_packages/package_control/installation#ST3
the Packages/ folder listed below refers to the folder that opens when you use the Preferences > Browse Packages… menu.
# pass in a compiler option
add_definitions( -DSOME_DEFINE_TO_PASS_IN=0xCAFE )
# specify linker path
LINK_DIRECTORIES( ${paths_to_search_for} )