This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple script to setup your machine env to use a remote ROS master | |
# example usage: use_robot.sh myrobot | |
# where myrobot is a resolvable hostname or an IP address | |
NORMAL=`tput sgr0 2> /dev/null` | |
GREEN=`tput setaf 2 2> /dev/null` | |
# get the IP of our device we'll use to conect to the host |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
np.random.seed(0) | |
import torch | |
import torch.nn as nn | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
slim = tf.contrib.slim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# remember to make this file executable (`chmod +x`) before trying to run it | |
import rospy | |
from std_srvs.srv import Trigger, TriggerResponse | |
def trigger_response(request): | |
return TriggerResponse( | |
success=True, | |
message="Hey, roger that; we'll be right there!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
try: | |
# py>=3.2 | |
from tempfile import TemporaryDirectory | |
except ImportError: | |
from backports.tempfile import TemporaryDirectory | |
from pathlib2 import Path | |
def tempdir(files=None, **kw): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/realm/realm-js/issues/370#issuecomment-270849466 | |
export default class Realm { | |
constructor(params) { | |
this.schema = {}; | |
this.callbackList = []; | |
this.data = {}; | |
this.schemaCallbackList = {}; | |
params.schema.forEach((schema) => { | |
this.data[schema.name] = {}; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bash_profile is executed for login shells, | |
# .bashrc is executed for interactive non-login shells. | |
# We want the same behaviour for both, so we source .bashrc from .bash_profile. | |
# Also, when .bash_profile exists, bash ignores .profile, so we have to source | |
# it explicitly. | |
if [ -f "$HOME/.profile" ]; then | |
. "$HOME/.profile" | |
fi |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
NewerOlder