Skip to content

Instantly share code, notes, and snippets.

View jdanielcmedina's full-sized avatar
👋
Olá tech's.

Daniel Medina jdanielcmedina

👋
Olá tech's.
View GitHub Profile
@hygull
hygull / LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143.md
Last active December 16, 2023 19:30
LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@tomahock
tomahock / distritos-concelhos-freguesias-Portugal.json
Last active November 1, 2020 10:33
Level 1 = Distrito, Level 2 = Concelho, Level 3 = Freguesia. Update de 12-07-2016
[
{
"level": 1,
"code": 1,
"name": "Aveiro"
},
{
"level": 2,
"code": 101,
"name": "Águeda"
@m13z
m13z / twitter_oauth_curl.php
Last active November 22, 2018 02:41
Super simple PHP twitter oauth request without user context (https://dev.twitter.com/docs/auth/application-only-auth)
/*
* using curl
*/
$key = 'YOUR_KEY_HERE';
$secret = 'YOUR_SECRET_HERE';
$api_endpoint = 'https://api.twitter.com/1.1/users/show.json?screen_name=marcosfernandez'; // endpoint must support "Application-only authentication"
// request token
$basic_credentials = base64_encode($key.':'.$secret);
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@mortenjust
mortenjust / gist:2158504
Created March 22, 2012 14:00
getDistance calculate distance in km in javascript
function getDistance(lon1, lat1, lon2, lat2) {
var R = 6371; // Radius of the earth in km
var dLat = toRad(lat2-lat1);
var dLon = toRad(lon2-lon1);
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
return R * c; // Distance in km
}