Skip to content

Instantly share code, notes, and snippets.

View geolimber's full-sized avatar

Sergio Marchenko (CA2MYX) geolimber

View GitHub Profile
@Klerith
Klerith / git-alias.md
Last active July 11, 2024 13:46
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s status --short

Alternativa útil de status

git config --global alias.s status -sb

@pachanka
pachanka / search-with-gpg.sh
Last active May 7, 2023 17:57
A simple bash script to grep within a bunch of GPG encrypted files.
#!/bin/bash
#
# Usage search-with-gpg path/to/encrypted/files/*
#
if [ -z "$1" ]; then
echo "Usage: $0 'search string' [path/to/encrypted/files/*]";
exit 1;
else
SEARCH=$1;
@habibutsu
habibutsu / distance.py
Last active October 29, 2021 15:38
Different ways calculate geo-distance in Python
'''
Requirements:
geographiclib==1.46.3
pyproj==1.9.5.1
geopy==1.11.0
git+https://github.com/xoolive/geodesy@c4eb611cc225908872715f7558ca6a686271327a
geo-py==0.4
'''
from math import radians, sin, cos, asin, sqrt, pi, atan, atan2, fabs
from time import time
@alex-sysoev
alex-sysoev / gist:aa472d1fd0f25e5a1ced
Last active February 26, 2018 22:12 — forked from p404/gist:f0d37cb4b4912543f5a5
Server configuration for a rails application
# User: ubuntu
sudo apt-get update
sudo apt-get upgrade
# Access keys
vim .ssh/authorized_keys
# Hostname
sudo vim /etc/hostname
sudo vim /etc/hosts
@vseow
vseow / index.php
Last active September 3, 2019 09:35
Get Country from IP with PHP
<?php
$ip = $_SERVER['REMOTE_ADDR'];
//echo $ip;
// Docs: http://ip-api.com/docs/
// Capped at 250 lookups/min - can unban yourself if you go over http://ip-api.com/docs/unban
$xml = simplexml_load_file("http://ip-api.com/xml/".$ip);
echo $xml->country;
@endel
endel / getMoonPhase.js
Created March 25, 2015 16:04
Get Moon Phase by Date, written in JavaScript
/*
* modified from http://www.voidware.com/moon_phase.htm
*/
function getMoonPhase(year, month, day)
{
var c = e = jd = b = 0;
if (month < 3) {
year--;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 05:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@cypres
cypres / gpoint.php
Created February 23, 2011 14:20
PHP class to convert Latitude & Longitude coordinates into UTM & Lambert Conic Conformal Northing/Easting coordinates.
<?php
/**
* PHP class to convert Latitude & Longitude coordinates into UTM & Lambert Conic Conformal Northing/Easting coordinates.
*
* This class encapsulates the methods for representing a geographic point on the earth in three different coordinate systema. Lat/Long, UTM and Lambert Conic Conformal.
*
* Code for datum and UTM conversion was converted from C++ code written by Chuck Gantz (chuck.gantz@globalstar.com) from http://www.gpsy.com/gpsinfo/geotoutm/
* This code was converted into PHP by Brenor Brophy (brenor@sbcglobal.net) and later refactored for PHP 5.3 by Hans Duedal (hd@onlinecity.dk).
*