Skip to content

Instantly share code, notes, and snippets.

View psvehla's full-sized avatar

Peter Svehla psvehla

  • Sydney, Australia.
View GitHub Profile
@silent1mezzo
silent1mezzo / 0fixup.md
Created January 24, 2012 15:12 — forked from SethRobertson/index.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
package scripts.ddl
import com.liferay.portal.kernel.dao.orm.QueryUtil
import com.liferay.portal.kernel.search.*
import com.liferay.portal.kernel.util.GetterUtil
import com.liferay.portal.kernel.util.LocaleUtil
import com.liferay.portal.service.GroupLocalServiceUtil
import com.liferay.portal.util.PortalUtil
import com.liferay.portlet.dynamicdatalists.model.DDLRecord
import com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalServiceUtil
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@vihari
vihari / tf_print.py
Last active April 10, 2019 09:06
Tensorflow's tf.Print to stdout instead of default stderr
"""
The default tf.Print op goes to STDERR
Use the function below to direct the output to stdout instead
Usage:
> x=tf.ones([1, 2])
> y=tf.zeros([1, 3])
> p = x*x
> p = tf_print(p, [x, y], "hello")
> p.eval()
hello [[ 0. 0.]]