Skip to content

Instantly share code, notes, and snippets.

View jacknlliu's full-sized avatar

Jack Liu jacknlliu

  • State Key Laboratory of Robotics
  • China
View GitHub Profile
@jacknlliu
jacknlliu / emacs-auctex-config.el
Created September 29, 2015 02:52 — forked from pkazmierczak/emacs-auctex-config.el
This is a Gist that contains all the code snippets from my blogpost about Emacs for LaTeX configuration: http://piotrkazmierczak.com/2010/05/13/emacs-as-the-ultimate-latex-editor/
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-save-query nil)
;(setq TeX-PDF-mode t)
(require 'flymake)
(defun flymake-get-tex-args (file-name)
(list "pdflatex"
(list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
@jacknlliu
jacknlliu / xprofile.md
Created October 4, 2015 14:02 — forked from marbu/xprofile.md
searching for xprofile

xprofile file

Raw notes about ~/.xprofile script.

Upstream

Upstream DM which executes ~/.xprofile file in Xsession script:

  • GDM (Gnome): see Xsession.in
  • KDM (KDE 4): see genkdmconf.c
@jacknlliu
jacknlliu / BibTeXKeyOnly.js
Created October 7, 2015 15:00 — forked from spartanroc/BibTeXKeyOnly.js
New Features and Improvements on Zotero's Support of BibTeX Export
{
"translatorID": "12345",
"label": "BibTeX CiteKey-only Exporter",
"creator": "Simon Kornblith and Richard Karnesky with tweaks by Tan",
"target": "bib",
"minVersion": "2.1.9",
"maxVersion": "",
"priority": 200,
"inRepository": false,
"translatorType": 3,
@jacknlliu
jacknlliu / bbb_boot_service_instructions.md
Created March 10, 2016 04:10 — forked from tstellanova/bbb_boot_service_instructions.md
How to setup a service to automatically run a python script when the BeagleBone Black (BBB) reboots. These instructions allow you to setup a python script to automatically start when the BeagleBone (running Angstrom linux with systemd) restarts.

Creating a service to startup at BeagleBone Black boot time:

  • Create a shell script such as /usr/bin/myFancyBash.sh:

      #!/bin/bash
    
      # this could be any runnable code or shell script, really
      /usr/bin/myFancyPython.py 
    

Note that the first line is critical.

@jacknlliu
jacknlliu / pandocslides-README.md
Created July 31, 2016 09:08
A Pandoc template to generate reveal.js slideshows.

Description

This is a Pandoc template to generate reveal.js slideshows.

Definitions

Pandoc is a "universal markup converter" you can run from the command line to convert a simple, plain text file into a beautifully formatted PDF, .docx, HTML, LaTeX, slideshows… the list goes on.

reveal.js is a CSS and JavaScript framework for creating beautiful presentations in HTML5, designed by Hakim El Hattab.

@jacknlliu
jacknlliu / gmm.py
Created June 13, 2017 09:28 — forked from bistaumanga/gmm.py
Gaussian Mixture Model using Expectation Maximization algorithm in python
# -*- coding: utf-8 -*-
"""
Created on Sat May 3 10:21:21 2014
@author: umb
"""
import numpy as np
class GMM:
@jacknlliu
jacknlliu / simple_args_parsing.sh
Created June 29, 2017 03:51 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@jacknlliu
jacknlliu / parse-options.sh
Last active August 4, 2017 09:53 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
# getopt recognize the params and put unrecognize params after '--', so '--' is a very important flag for latter work.
# -o for options like: -v -h -n -s
# --long for options like: --verbose --dry-run --help --stack-szie
# and which options followed by a ':' will have format like -s 3, --stack-size 4 or -s=3 --stack-size=4
# -n: name of the shell script
@jacknlliu
jacknlliu / docker_descendants.py
Created November 3, 2017 01:20 — forked from altaurog/docker_descendants.py
Python3 script to find descendants of one or more docker images
#!/usr/bin/python3
#
# usage: python3 docker_descendants.py <image_id> ...
import sys
from subprocess import check_output
def main(images):
image_ids = set(images)
@jacknlliu
jacknlliu / topics_to_ssv.py
Created November 13, 2017 02:38 — forked from garaemon/topics_to_ssv.py
a script to output the values of ros topics into a text file
#!/usr/bin/env python
import roslib
roslib.load_manifest("sensor_msgs")
roslib.load_manifest("message_filters")
roslib.load_manifest("rxtools")
import rospy
import rxtools
import rxtools.rosplot
import sys