Skip to content

Instantly share code, notes, and snippets.

@fooqri
fooqri / README.md
Last active February 8, 2022 21:23
dynamic client side searching for Hugo.io with Fuse.js
{
"title": "Change tab key",
"rules": [
{
"description": "Change tab key to command+control+option+shift. (Post tab key when pressed alone)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab",
{
"title": "Change spacebar",
"rules": [
{
"description": "Change spacebar to right-option if pressed with other keys (Post spacebar when pressed alone)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar",
@fooqri
fooqri / emacs-w-tensorflow-notes.md
Last active September 21, 2020 04:37
Notes for adding tensorflow support to Emacs Org-mode code blocks on OS X
@fooqri
fooqri / ql-thoughts.sh
Last active December 10, 2016 21:46
A few alias functions for using qlmanage to create png files. Used for creatingpng previews of iThoughtsX files that can be embedded in org-mode notes.
# qlmanager is used to open quicklook view of a file from command line.
# see http://www.quicklookplugins.com/ for more plugins
# an alias to create a simple command to olen a quicklook view in background, showing no terminal messages
alias ql='function _qlfunc(){ qlmanage -p $@ >/dev/null 2>&1 &};_qlfunc'
# I use this to save png files using qlmanager into an images directory inside my org-mode notes dir.
# I use a lisp function that calles this comand when org-links are added to notes so I get a nice embedded png view
# of the file being linked to. Requires plugin for file type that creates png's
# I use for mindmaps, stl files, etc so canshow quicklook inside emacs org-mode for linked files
@fooqri
fooqri / create-ithoughts-file-link.el
Last active December 10, 2016 16:34
Org-Mode add link to iThoughtsX mindmap file. Create file if it doesn't exist.
@fooqri
fooqri / IoTPlatformNotes.md
Last active January 4, 2016 19:58
IoT & Wearable Platform Notes

Here are a few notes about interesting dev boards I have used for "Internet of Things (IoT)" projects.

The ESP8266

The ESP8266 was developed as a wifi board, but its integrated micro controller makes it an interesting platform for lots of uses. By adding the Arduino Core you can program it using the Arduino environment. I have used ESP8266 on a number of projects successfully. It is a bit power hungry because of the wifi, but it has support for sleep mode between sensor readings and broadcasts that can prolong battery life. If the IoT device is connected to power then this is an easy choice, as it is so low cost, and wifi makes it easy to push data to a server.

Two nice boards are:

Additio

Intel Edison Setup

Flash Edison with latest Image (Linux)

  • Plug both micro USB cables from Edison Dev board into linux pc, no power wall wart needed

in terminal (ttyUSB0 is example, could be ttyUSB1, etc based on usb port used.)

  • open a terminal and type sudo screen /dev/ttyUSB0 115200
  • reset edison using reset button
  • keep hitting a key until stop boot at a boot prompt
  • type run do_flash
@fooqri
fooqri / gist:5691402
Created June 1, 2013 19:10
init.el excerpt
(defun quick-copy-line ()
"Copy the whole line that point is on and move to the beginning of the next line.
Consecutive calls to this command append each line to the
kill-ring."
(interactive)
(let ((beg (line-beginning-position 1))
(end (line-beginning-position 2)))
(if (eq last-command 'quick-copy-line)
(kill-append (buffer-substring beg end) (< end beg))
(kill-new (buffer-substring beg end))))
@fooqri
fooqri / app_delegate.rb
Last active December 12, 2015 06:59
Excerpt from app delegate for setting up RestKit logging. I was getting an undefined constant error for RKLogConfigureByName, the standard way of setting up logging in restkit. It seems that the #define statements in /vendor/Pods/RestKit/Code/Support/RKLog.h are not getting picked up. I will need to investigate further but this quick workaround …
def init_restkit_logging
#define RKLogLevelOff -> RKlcl_vOff
#define RKLogLevelCritical -> RKlcl_vCritical
#define RKLogLevelError -> RKlcl_vError
#define RKLogLevelWarning -> RKlcl_vWarning
#define RKLogLevelInfo -> RKlcl_vInfo
#define RKLogLevelDebug -> RKlcl_vDebug
#define RKLogLevelTrace -> RKlcl_vTrace
# "restkit" "RestKit"