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
@jdanielcmedina
jdanielcmedina / twitter_oauth_curl.php
Created June 18, 2018 03:43 — forked from m13z/twitter_oauth_curl.php
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);
@jdanielcmedina
jdanielcmedina / github-oauth2-client.php
Created June 2, 2018 15:20 — forked from hamedmoody/github-oauth2-client.php
Simple PHP example of using Github's OAuth 2 API
<?php
define('OAUTH2_CLIENT_ID', '');
define('OAUTH2_CLIENT_SECRET', '');
$authorizeURL = 'https://github.com/login/oauth/authorize';
$tokenURL = 'https://github.com/login/oauth/access_token';
$apiURLBase = 'https://api.github.com/';
session_start();
@jdanielcmedina
jdanielcmedina / vuejs_problems.js
Last active February 22, 2018 03:14
vuejs title problem with webpack/uglify
# if you have get error on webpack/uglify with this
router.beforeEach((to, from, next) => {
document.title = to.meta.title
next()
})
# change with this
router.beforeEach(function(to, from, next){
document.title = to.meta.title
next()
@jdanielcmedina
jdanielcmedina / distritos-concelhos-freguesias-Portugal.json
Last active October 29, 2017 18:26 — forked from tomahock/distritos-concelhos-freguesias-Portugal.json
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"
@jdanielcmedina
jdanielcmedina / paisesPortuguesIngles.sql
Created October 2, 2016 03:29 — forked from thiagosilr/paisesPortuguesIngles.sql
Tabela MYSQL com o nome de todos os países em Português / Inglês
--
-- Estrutura da tabela `pais`
--
CREATE TABLE IF NOT EXISTS `pais` (
`paisId` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`paisNome` varchar(50) NOT NULL,
`paisName` varchar(50) NOT NULL,
PRIMARY KEY (`paisId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=253 ;
@jdanielcmedina
jdanielcmedina / designer.html
Last active August 29, 2015 14:23
designer
<link rel="import" href="../paper-progress/paper-progress.html">
<polymer-element name="my-element">
<template>
<style>
#paper_progress {
left: 90px;
top: 90px;
position: absolute;