Skip to content

Instantly share code, notes, and snippets.

@marcw
marcw / export-database.sh
Created October 23, 2010 12:35
Automatically export a magento database and change all the base_url references
#!/bin/bash
# Export options
if [[ -z "$1" || -z $2 ]]
then
echo "export-database.sh"
echo " usage: ./export-database current_host distant_host"
echo " example: ./export-database my.local.host my.other.host"
exit 1;
fi
@marcw
marcw / .gitconfig
Created February 22, 2011 18:05
git lint alias
[alias]
lint = "!sh -c 'git status | awk \"/modified/ {print \\$3} /new file/ {print \\$4}\" | xargs -L 1 php -l'"
@hartym
hartym / the_early_morning_framework.py
Created August 18, 2011 05:40
the_early_morning_framework.py
"""
Welcome to "what better thing to do than coding a web app while drinking my
morning coffee"-framework.
It show how easy it is to code a standalone/state-of-the-art mini web application
using python, and some amazing libraries available around.
Disclaimer
----------
@mitchellh
mitchellh / gist:6531113
Last active December 23, 2015 21:08
`go get` replacement that works around Go issue #5375 (go get doesn't work with private Bitbucket repositories)
#!/bin/bash
#
# Due to a bug in Go, you can't `go get` a private Bitbucket repository
# (issue #5375, linked below). This means you can't `go get ./...` ANY project
# that might depend on a private Bitbucket repository.
#
# This script works around it by detecting Bitbucket imports and using
# `git` directly to clone into it. This will not work if you use private
# Mercurial repositories on Bitbucket.
#
@filipefigcorreia
filipefigcorreia / kafka-cheat-sheet.md
Last active February 8, 2023 09:29
Apache Kafka Cheat Sheet

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --delete-config retention.ms

@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active November 15, 2024 17:51
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se