Skip to content

Instantly share code, notes, and snippets.

View thomascrepain's full-sized avatar
🎯
Focusing

Thomas Crepain thomascrepain

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am thomascrepain on github.
  • I am thomascrepain (https://keybase.io/thomascrepain) on keybase.
  • I have a public key ASA0GbIhixMs46JzyUDRonhn3bu7tqUzZqn1aBTv6-SVvwo

To claim this, I am signing this object:

@thomascrepain
thomascrepain / ADB Cheat Sheet
Last active September 26, 2019 09:12
Android Debug Bridge (adb) cheat sheet - much used but not remembered
source: http://adbshell.com/commands
# Link to phone
adb devices
adb shell
# Download file from phone
adb pull /sdcard/path/to/file
# Download multiple files from phone
#!/bin/bash
# Installs the bare minimum to start a docker container on a Raspberry Pi. Make sure you start from a fresh copy of Raspbian (light)
# See: https://www.raspberrypi.org/downloads/raspbian/
#
# Run this script as sudo
# Install docker
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
@thomascrepain
thomascrepain / geo.md
Created October 1, 2015 11:34
Latitude/Longitude

Calculate distance, bearing and more between Latitude/Longitude points http://www.movable-type.co.uk/scripts/latlong.html

-- Spherical Law of Cosines: calculate distance to other points

SET @lat = 51.053283, @lon = 3.720359;
SELECT *
FROM (
       SELECT
 *,
@thomascrepain
thomascrepain / broken-links-test
Last active August 29, 2015 14:16
Test website for broken links
@thomascrepain
thomascrepain / Timer.php
Last active August 29, 2015 14:10
Timer class
<?php
/**
* Class Timer
*/
class Timer
{
/**
* @var float|null
*/
protected $startTime;
@thomascrepain
thomascrepain / Command line magic Cheat Sheet
Last active January 11, 2021 19:51
Command line magic Cheat Sheet - much used but not remembered
# Search & replace over multiple files (Linux)
find . -type f -print0 | xargs -0 sed -i 's/foo/bar/g'
# Search & replace over multiple files (Mac OS X)
find . -type f -print0 | xargs -0 sed -i '' -e 's/foo/bar/g'
# remove empty files in a directory
find /tmp -size 0 -print0 |xargs -0 rm
# Run command in multiple directories
for dir in ./*; do (cd "$dir" && echo "$dir" && cowsay "boo"); done
# Ignore everything in this directory
*
# Except this file
!.gitignore
@thomascrepain
thomascrepain / Git Cheat Sheet
Last active March 9, 2023 09:25
Git Cheat sheet - much used but not remembered
# refresh remote branches
git fetch -p
# checkout remote branch
git checkout -t origin/branchname
# delete local branch
git branch -d branchname
# list remote branch