Skip to content

Instantly share code, notes, and snippets.

View Fahrek's full-sized avatar

Andres G. Quina Fahrek

View GitHub Profile
@Fahrek
Fahrek / gist:8bf0c1eb39c36d0a27603bdf1d274e20
Created August 4, 2019 07:59 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@Fahrek
Fahrek / fill-form-with-voice.markdown
Created April 29, 2019 17:55
Fill Form with voice
function print() {
const filename = 'ThisIsYourPDFFilename.pdf';
html2canvas(document.querySelector('#nodeToRenderAsPDF')).then(canvas => {
let pdf = new jsPDF('p', 'mm', 'a4');
pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, 211, 298);
pdf.save(filename);
});
}
@Fahrek
Fahrek / phonePrefixCodesWithCountry.php
Created March 19, 2019 10:22 — forked from grexlort/phonePrefixCodesWithCountry.php
List of phone prefix codes with country in PHP array format prefix => country +xxx
// data from https://gist.github.com/andyj/7108917
$array = [
'44' => 'UK (+44)',
'1' => 'USA (+1)',
'213' => 'Algeria (+213)',
'376' => 'Andorra (+376)',
'244' => 'Angola (+244)',
'1264' => 'Anguilla (+1264)',
'1268' => 'Antigua & Barbuda (+1268)',
@Fahrek
Fahrek / countries.php
Created March 19, 2019 10:22 — forked from josephilipraja/countries.php
List of Countries with Country code & Telephone (Dial) Code as a PHP Array. Bonus: PHP function to list all Countries as HTML Select Tag Options with their 2 character Country code as values
<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),
@Fahrek
Fahrek / index.html
Created December 16, 2018 03:02
MouseEffectJS
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="content-fluid">
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DataExportManager">
<export-instructions>
<create-header value="true" />
import java.text.DecimalFormat;
import javax.swing.JOptionPane;
public class TuitionCost {
public static void main(String[] args) {
int costHours;
int student;
String input;
@Fahrek
Fahrek / CH01 - JSON Meeting Request.md
Last active May 18, 2018 10:27
CH01 - JSON Meeting Request


Meeting Request