Skip to content

Instantly share code, notes, and snippets.

Christian Fritz chfritz

Block or report user

Report or block chfritz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chfritz
chfritz / meteor_add_cordova.sh
Last active Jul 19, 2016
Make it easy to add cordova plugins to meteor just from knowing the github url.
View meteor_add_cordova.sh
#!/bin/bash
# Given a github url for a corvoda plugin, such as
#
# https://api.github.com/repos/cordova-sms/cordova-sms-plugin/
#
# this node.js script will generate the appropriate format for "meteor
# add" using the last commit for the tarball and pass it to meteor add.
# For instance, for the above:
#
@chfritz
chfritz / meteor_deps.sh
Created Aug 4, 2015
A script for checking the two-step package dependencies of a meteor project, i.e., the package dependencies of direct dependencies (as seen in `meteor list`).
View meteor_deps.sh
meteor list | grep ^[a-z] | tr -s ' ' | cut -d ' ' -f1,2 | tr -d '\*\+' | tr ':' '_' \
| while read X Y; do \
cat ~/.meteor/packages/$X/$Y/web.browser.json \
| xargs -0 node -e "X = JSON.parse(process.argv[1]); \
X.uses.forEach(function(d) { \
console.log(\"$X\", \"$Y\", d.package, d.constraint); \
})"; \
done | sort
@chfritz
chfritz / seejson.sh
Created Jun 16, 2014
A tiny bash script that loads a given JSON file into an interactive node.js shell. Once the shell is loaded, look at the variable `json`.
View seejson.sh
#!/bin/bash
# explore a JSON file in node.js
# run: seejson.sh file.json
# then look at "json" in the opening node shell
node -e "json = require(\"./$1\"); repl = require(\"repl\").start(\"> \"); console.log(\"loaded... see json\");"
@chfritz
chfritz / simpleFileDragAndDrop.js
Last active May 29, 2019
HTML5: simple file drag&drop (without upload).
View simpleFileDragAndDrop.js
/*
(MIT License)
Copyright (c) 2012 Christian Fritz
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
@chfritz
chfritz / svnup_color
Created Jan 3, 2014
A small wrapper script for 'svn up' that sorts and colors the output depending on the type of the entry, e.g., yellow for untracked files, green for updated, blue for merged.
View svnup_color
#!/bin/bash
BLACK="\033[30m"
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
BLUE="\033[34m"
PINK="\033[35m"
CYAN="\033[36m"
WHITE="\033[37m"
@chfritz
chfritz / squeezing.tex
Created Dec 5, 2013
A tex file full of tricks for squeezing a latex document. Clearly you should avoid using these tricks. But when the deadline is near and you see no other way, you can use it to quickly change the formatting slightly to get more space. Just comment in some of the length changes or add other for the described sizes.
View squeezing.tex
%% /** ---------------------------------------------------------
%% a file full of squeezing options
%% -- which you should try to avoid
%% -------------------------------------------------------------
%%
%% from:
%% http://www.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html
%% ---------------------------------------------------------- */
%% * Page Layout
%% o \columnsep: gap between columns
@chfritz
chfritz / fileDragAndDrop.js
Created Jun 18, 2013
If you like the file drag&drop functionality of knistr and would like to use it on your own page, you can. We are making this little piece of javascript available under the liberal MIT license. You can use it to turn any div element into a drop container, and specify a URL to upload the file to. If the server you are uploading to does something …
View fileDragAndDrop.js
/*
(MIT License)
Copyright (c) 2012 Christian Fritz
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
@chfritz
chfritz / aaai_script.sh
Last active Oct 19, 2017
This shell script produces the latex source-package of a paper as required by AAAI, in preparation for printed proceedings.
View aaai_script.sh
#!/bin/bash
# ----------------------------------------------------------------------
# This shell script produces the latex source-package of a paper
# as required by AAAI, in preparation for printed proceedings.
# Copyright (C) 2009 Christian Fritz "fritz at cs dot toronto dot
# edu"
#
# I thank Jorge Baier for his contributions and Shirin Sohrabi for her
# feedback that has lead to improvements to the script. Thanks also
You can’t perform that action at this time.