Skip to content

Instantly share code, notes, and snippets.

View EloneSampaio's full-sized avatar

Sam EloneSampaio

View GitHub Profile
<?php
namespace models;
use InvalidArgumentException;
/**
* @Entity
* @Table(name="categories")
*/
class Categories {
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
jQuery.validator.addMethod("cnpj", function (cnpj, element) {
cnpj = jQuery.trim(cnpj);
// DEIXA APENAS OS NÚMEROS
cnpj = cnpj.replace('/', '');
cnpj = cnpj.replace('.', '');
cnpj = cnpj.replace('.', '');
cnpj = cnpj.replace('-', '');
var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
@EloneSampaio
EloneSampaio / app.css
Created July 20, 2016 22:57 — forked from rdtsc/app.css
NW.js Windows PDF Printing Demo
body {
font-family: sans-serif;
}
section {
margin-bottom: 40px;
}
h1 {
font-size: 20px;
@EloneSampaio
EloneSampaio / handlebars-helper-x.js
Created July 30, 2016 00:29 — forked from akhoury/handlebars-helper-x.js
Handlebars random JavaScript expression execution, with an IF helper with whatever logical operands and whatever arguments, and few more goodies.
// for demo: http://jsbin.com/jeqesisa/7/edit
// for detailed comments, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381
/* a helper to execute an IF statement with any expression
USAGE:
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes
-- to access any global function or property you should use window.functionName() instead of just functionName()
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later
<p>
{{#xif " this.name == 'Sam' && this.age === '12' " }}
@EloneSampaio
EloneSampaio / auth.js
Created August 19, 2016 00:42 — forked from katowulf/auth.js
Auth with Firebase 3.x and Cordova/Ionic using ngCordova oauth.
this.$cordovaOauth.facebook("your_client_id", ["email"])
.then(function (result) {
var credentials = firebase.auth.FacebookAuthProvider.credential(result.access_token);
return firebase.auth().signInWithCredential(credentials);
})
.then(function (firebaseUser) {
console.log("Signed in as:", firebaseUser.uid);
})
.catch(function (error) {
console.error("Authentication failed:", error);
@EloneSampaio
EloneSampaio / genymotionwithplay.txt
Created December 13, 2016 18:18 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Link de maquinas virtuas android genymotion
http://dl.softrayane.ir/soft/utilities/mobile-phone-tool/Genymotion.v2/
<html>
<head>
<title>Teste PHP</title>
</head>
<body>
<?php echo "<p>Olá Mundo</p>"; ?>
</body>
</html>