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
@djsutherland
djsutherland / latex-clean.sh
Last active July 16, 2024 11:39
A bash script to clean latex temp files
#!/bin/bash
# Note: you might prefer latexmk -c since latexmk is great. It doesn't clean all of these, but see
# https://tex.stackexchange.com/questions/83341/clean-bbl-files-with-latexmk-c/83386#83386
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys"
for x in "${@:-.}"; do
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//')
@garaemon
garaemon / topics_to_ssv.py
Created February 17, 2011 12:24
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
@jehiah
jehiah / simple_args_parsing.sh
Created March 4, 2011 16:56
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"
@austinmarton
austinmarton / linux_timerfd_example.c
Created July 13, 2012 09:23
Linux file descriptor timers example
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@cosimo
cosimo / parse-options.sh
Created September 21, 2012 09:31
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@mugli
mugli / install-java7.sh
Created January 30, 2014 21:51
Silently install Oracle Java 7 on Ubuntu (without license agreement step)
#!/bin/bash
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
# Enable silent install
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
@minshallj
minshallj / foo.js
Last active March 13, 2023 18:28
roslibjs example
//* The Ros object, wrapping a web socket connection to rosbridge.
var ros = new ROSLIB.Ros({
url: 'ws://localhost:9090' // url to your rosbridge server
});
//* A topic for messaging.
var exampleTopic = new ROSLIB.Topic({
ros: ros,
name: '/com/endpoint/example', // use a sensible namespace
messageType: 'std_msgs/String'
@fperez
fperez / nbmerge.py
Created June 23, 2015 01:04
Merge/concatenate multiple IPython notebooks into one.
#!/usr/bin/env python
# Note, updated version of
# https://github.com/ipython/ipython-in-depth/blob/master/tools/nbmerge.py
"""
usage:
python nbmerge.py A.ipynb B.ipynb C.ipynb > merged.ipynb
"""
import io
@cirocosta
cirocosta / sigev_thread2.c
Created August 29, 2015 18:27
Posix Interval Timer example w/ threads
/*
* ORIGINAL HEADER
*
* sigev_thread.c
*
* Demonstrate use of the SIGEV_THREAD signal mode to handle
* signals by creating a new thread.
*
* Special notes: This program will not compile on Solaris 2.5.
* It will compile on Digital UNIX 4.0 but will not work.
@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)))