Skip to content

Instantly share code, notes, and snippets.

@lucasmlessa
lucasmlessa / generator.php
Created August 6, 2017 04:43 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@lucasmlessa
lucasmlessa / .bash_profile
Created December 5, 2016 05:13 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@lucasmlessa
lucasmlessa / base.php
Created January 25, 2016 00:30
Consulta de Listas em Ajax com método POST
<?php
if($_POST['valor'] == '001'){ echo "Águas Lindoya";}
elseif($_POST['valor'] == '003'){echo "Água Bonafont";}
elseif($_POST['valor'] == '004'){echo "Água Cristal";}
elseif($_POST['valor'] == '005'){echo "Águas Perrier";}
else{echo "Nada encontrado =/";}
?>
@lucasmlessa
lucasmlessa / gist:755c7228c0cc379869b8
Created June 30, 2015 22:14
Player do Youtube em ActionScript 3
Security.allowDomain("www.youtube.com");
var videoPlayer:Object;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
function onLoaderInit(event:Event):void {
youTuba.addChild(loader); // MovieClip (Objeto) onde será carregado o vídeo
$(function(){
var model = {
init: function() {
if (!localStorage.notes) {
localStorage.notes = JSON.stringify([]);
}
},
add: function(obj) {
var data = JSON.parse(localStorage.notes);
// Simple script that exports a users "Saved For Later" list out of Feedly
// as a JSON string.
//
// This was intended for use in the Google Chrome's "Inspector" tool so your
// mileage may vary if used in other contexts.
//
// Format of JSON is as follows:
// [
// {
// title: "Title",
WebFontConfig = {
google: { families: [ \'Ek+Mukta:200,800:latin\' ] }
};
var cb = function() {
var wf = document.createElement(\'script\');
wf.src = \'//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js\';
wf.type = \'text/javascript\';
wf.async = \'true\';
var s = document.getElementsByTagName(\'script\')[0];
s.parentNode.insertBefore(wf, s);
<!DOCTYPE html>
<html>
<head>
<title>MemeMaker-Simple</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
@lucasmlessa
lucasmlessa / gist:74eeb4931c25299879c4
Created March 10, 2015 03:59
Bootstrap 3 Media Queries
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
@lucasmlessa
lucasmlessa / gist:7c17a979fead882b07f6
Created March 10, 2015 01:21
Retorna parâmetros da URL com Javascript
function getUrlParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return sParameterName[1];