Skip to content

Instantly share code, notes, and snippets.

View blogui91's full-sized avatar
🎯
Focusing

Cesar Santana blogui91

🎯
Focusing
  • Doorvel
  • Monterrey
  • 09:20 (UTC -06:00)
View GitHub Profile
@blogui91
blogui91 / gist:90859fb318f358876187a5a1fde2dacc
Created February 11, 2020 23:56 — forked from alisterlf/gist:3490957
JAVASCRIPT:Remove Accents
function RemoveAccents(strAccents) {
var strAccents = strAccents.split('');
var strAccentsOut = new Array();
var strAccentsLen = strAccents.length;
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
} else
@blogui91
blogui91 / build.gradle
Created January 26, 2019 22:15 — forked from jkasten2/build.gradle
OneSignalSDK version matching error when using google-services plugin
//App build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
android {
compileSdkVersion 27
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@blogui91
blogui91 / pivot_example.php
Created August 30, 2018 21:30 — forked from fractefactos/pivot_example.php
Laravel Custom Pivot Model definition example
<?php
//https://github.com/laravel/framework/issues/2093#issuecomment-39154456
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\Relations\Pivot;
class User extends Eloquent {
public function groups() {
return $this->belongsToMany('Group');
@blogui91
blogui91 / README.md
Created March 8, 2018 16:39 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@blogui91
blogui91 / LICENSE
Created March 5, 2018 02:24 — forked from ifraixedes/LICENSE
Private properties on ES6 Classes using Proxies
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
(http://www.wtfpl.net/about/)
Copyright (C) 2015 Ivan Fraixedes (https://ivan.fraixed.es)
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
API_URL=https://api.example.com
CLIENT_ID=
CLIENT_SECRET=
FIREBASE_SECRET=
API_URL=https://api.example.com
CLIENT_ID=122554888
CLIENT_SECRET=XXXXXXX
FIREBASE_SECRET=XXXXXX
// config/envparser.js
const DotEnv = require('dotenv')
const parsedEnv = DotEnv.config().parsed
module.exports = function () {
// Let's stringify our variables
for (key in parsedEnv) {
if (typeof parsedEnv[key] === 'string') {
parsedEnv[key] = JSON.stringify(parsedEnv[key])
}
const DotEnv = require('dotenv')
const parsedEnv = DotEnv.config().parsed
module.exports = function () {
// Let's stringify our variables
for (key in parsedEnv) {
if (typeof parsedEnv[key] === 'string') {
parsedEnv[key] = JSON.stringify(parsedEnv[key])
}
}