Skip to content

Instantly share code, notes, and snippets.

View gabrielhpugliese's full-sized avatar

Gabriel H Pugliese gabrielhpugliese

View GitHub Profile
<VirtualHost *:80>
ServerName server_name
ServerAdmin administrador@ehnoiz.com.br
AssignUserID user_name user_name
#DocumentRoot "/home/user_name/site_env/web_app/user_name/public/"
#<Directory />
# Options FollowSymLinks
# AllowOverride None
@gabrielhpugliese
gabrielhpugliese / gist:3210236
Created July 30, 2012 21:05
nginx wordpress config
server{
listen 80; #or change this to your public IP address eg 1.1.1.1:80
server_name www.blogcloud.com.br; #change this to the domain name, for example www.myblog.com
access_log /var/log/wordpress.access_log;
error_log /var/log/wordpress.error_log;
location / {
root /home/wordpress/public_html/wordpress;
index index.php;
class Ze():
attr1 = 'viadinho'
def __init__(self):
# Isso e um construtor
self.attr2 = 'gayzola'
def canta_hino(self, time='palmeiras'):
if(time == 'palmeiras'):
return 'Quando surge...'
return 'Nem'
@gabrielhpugliese
gabrielhpugliese / gist:3725414
Created September 14, 2012 22:40
Meteor unload
window.onbeforeunload = function(e) {
var message = "Your confirmation message goes here.";
var name = Session.get('name');
Name.remove(nome);
Meteor.flush();
return message;
};
Nomes = new Meteor.Collection("nomes");
Nome = {
remove : function(nome) {
return Nomes.remove({
nome : nome
});
},
get : function(nome) {
return Nomes.findOne({
@gabrielhpugliese
gabrielhpugliese / gist:3735085
Created September 17, 2012 01:16
Meteor method is not working
Nomes = new Meteor.Collection("nomes");
Nome = {
remove : function(nome) {
return Nomes.remove({
nome : nome
});
},
get : function(nome) {
return Nomes.findOne({
@gabrielhpugliese
gabrielhpugliese / googledrive.js
Last active August 25, 2020 08:22
Google Drive
var CLIENT_ID = '454038495802.apps.googleusercontent.com';
var SCOPES = 'https://www.googleapis.com/auth/drive';
/**
* Called when the client library is loaded to start the auth flow.
*/
function handleClientLoad() {
window.setTimeout(checkAuth, 1);
}
@gabrielhpugliese
gabrielhpugliese / gist:3763872
Created September 21, 2012 21:02
onbeforeunload meteor
Names = new Meteor.Collection("names");
Name = {
remove : function(name, room) {
return Names.remove({
name : name,
room : room,
host : PARENT // It's a string
});
},
get : function(name, room) {
@gabrielhpugliese
gabrielhpugliese / gist:3929083
Created October 22, 2012 00:34
Facebook trouble
Template.body.connected = function(){
return Meteor.userLoaded();
};
Template.body.have_game = function(){
//get into game ...
}
Template.index.created = function(){
//list facebook friends
@gabrielhpugliese
gabrielhpugliese / gist:3973245
Created October 29, 2012 12:24
google drive
var CLIENT_ID = '[%client_id%]';
var SCOPES = 'https://www.googleapis.com/auth/drive';
/**
* Called when the client library is loaded to start the auth flow.
*/
function handleClientLoad() {
window.setTimeout(checkAuth, 1);
}