Skip to content

Instantly share code, notes, and snippets.

@Miguelos
Miguelos / LocationTrackingService.kt
Created March 9, 2017 10:44 — forked from anonymous/LocationTrackingService.kt
Android location tracking background service in Kotlin language. Referenced from: http://stackoverflow.com/a/28535885/1441324
import android.app.Service
import android.content.Context
import android.content.Intent
import android.location.Location
import android.location.LocationManager
import android.os.Bundle
import android.util.Log
class LocationTrackingService : Service() {
<?php
/**
* @file My Drush Commands
*/
/**
* Implementation of hook_drush_help()
*/
function my_drush_help($section) {
switch ($section) {
@Miguelos
Miguelos / install-awscli.sh
Last active August 29, 2015 13:56
Install Amazon AWS Command Line Interface
## Sources:
# https://github.com/aws/aws-cli
# https://aws.amazon.com/cli/
# http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html
##
# Requires Python 2.6 or higher
sudo python get-pip.py
sudo pip install awscli
@Miguelos
Miguelos / gist:7368790
Created November 8, 2013 09:53
Useful basic git aliases
alias gpl='git pull'
alias gps='git push'
alias gb='git branch -a -v'
alias gbu='git branch --set-upstream-to' # needs the name of an upstream branch, sets up remote tracking for the local branch (really useful with `gcb` above
alias gs='git status'
alias ga='git add -A'
alias gau='git add -u'
alias gr='git ls-files --deleted -z | xargs -0 git rm'
alias gd='git diff -- color=always'
@Miguelos
Miguelos / x-screens.sh
Created February 25, 2013 12:08
Select dual or single screen configuration using xrandr
#!/bin/sh
# This line is to get the display names
echo "Screens connected:"
xrandr | grep " connected" | awk '{print $1}'
echo "Auto configuration:"
if (xrandr | grep "HDMI2" | grep " connected" > /dev/null) then
echo "Dual screen configuration"
exec xrandr --output HDMI2 --mode 1280x1024 --pos 0x0 --rotate normal --output LVDS1 --mode 1366x768 --pos 1280x128 --rotate normal --output VGA2 --off --output DP1 --off