Skip to content

Instantly share code, notes, and snippets.

View rm--'s full-sized avatar

René rm--

View GitHub Profile
@victorgan
victorgan / gist:cbf7e0216e802844198a
Last active March 15, 2020 14:47
Installing ROS Indigo on a Ubuntu 14.04 Fresh Install
# Literally, from a completely fresh install, except for system updates.
# START TUTORIAL: http://wiki.ros.org/indigo/Installation/Ubuntu
# Note: In Ubuntu 9.04 (Jaunty) and later, the main, universe, restricted and multiverse repositories are enabled by default.
# accept software from ROS sources
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
# set up keys
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
@phrawzty
phrawzty / 2serv.py
Last active May 31, 2024 17:14
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@DeTeam
DeTeam / codeship.sh
Created December 30, 2014 19:13
Codeship Haskell setup commands
# Codeship + Haskell (cabal)
cabal update
cabal install cabal-install
export PATH=$HOME/.cabal/bin:$PATH
cabal sandbox init
cabal install --only-dependencies --enable-tests
cabal configure --enable-tests
cabal build
@yantonov
yantonov / install-ghc-macos.md
Last active August 23, 2019 03:31
How to install latest GHC from source + latest stack + cabal + cabal-install on mac os

How to install GHC from source + latest stack + cabal + cabal-install on mac os

for your convinience this instuction is available as:
gist
git repo

Prefererred way install stack then install ghc using stack

stack (package manager and build tool, preferrered way to manage dependencies)

@shajra
shajra / alacarte.scala
Last active May 6, 2019 20:53 — forked from runarorama/gist:a8fab38e473fafa0921d
"datatypes a la carte" pattern in Scala
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
@gschueler
gschueler / rundeck-2.0.2-h2-upgrade.sh
Last active January 2, 2019 13:58
Upgrade rundeck 2.0.2 h2 database from earlier 2.0.x version.
#!/bin/bash
set -e
#set -x
RDECK_BASE=${RDECK_BASE:-$(pwd)}
CONFFILE=$1
H2JAR=$2
if [ -z "$CONFFILE" ] ; then
if [ -f ${RDECK_BASE}/server/config/rundeck-config.properties ] ; then
CONFFILE=${RDECK_BASE}/server/config/rundeck-config.properties
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active June 4, 2024 04:16
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@mscharhag
mscharhag / Java8DateTimeExamples.java
Created February 24, 2014 19:53
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {
@darryn
darryn / Shopify tag filter groups
Last active August 23, 2023 03:51
Create tag filter groups in Shopify. This snippet is designed to group and separate out collection tags. It requires the tags to share a common value prepended to the tag with an underscore. E.g. to create a separate tag filter group for 'brands', each product will need to be tagged with 'brand_Nike' or 'brand_Reebok'. Some of this is probably l…
{% if template contains 'collection' and collection.all_tags.size > 1 %}
<!-- A recursive loop to catch and filter out the different tag categories -->
{% assign c = 0 %}
{% for t in collection.all_tags %}
{% capture cat %}{{ cat }}{% capture temp_cat %}{% if t contains '_' %}{% assign cat_grp = t | split: '_' %}{{ cat_grp.first }}{% endif %}{% endcapture %}{% unless cat contains temp_cat %}{% if t contains '_' %}{% assign new_cat_grp = t | split: '_' %}{{ new_cat_grp.first }}{% endif %}{% unless forloop.last %}+{% endunless %}{% assign c = c | plus: 1 %}{% endunless %}{% endcapture %}
{% endfor %}
<!-- create array of tag categories -->
{% assign cat_array = cat | split: '+' %}
@timmytofu
timmytofu / ghcPkgUtils.sh
Last active June 6, 2020 12:02 — forked from simonmichael/gist:1185421
ghc-pkg-clean and ghc-pkg-reset compatible with both zsh and bash
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.