Skip to content

Instantly share code, notes, and snippets.

View NeftaliYagua's full-sized avatar

Neftalí Yagua NeftaliYagua

View GitHub Profile
var DateTime = function() {
var now = new Date();
this.year = now.getFullYear();
this.month = ('00' + now.getMonth()).slice(-2);
var monthEndDate = new Date(this.year, this.month, 0);
this.startDate = this.year + '-' + this.month + '-01';
this.endDate = this.year + '-' + this.month + '-' + monthEndDate.getDate();
}
var Profile = function(profileName, tableId) {
<?php
use Zend\Loader\StandardAutoloader as Autoloader,
Zend\Db\Metadata\Metadata,
Zend\Db\Adapter\Adapter as DbAdapter;
/////////////////////////////////////
// Inicio de configuración
/////////////////////////////////////
//
//app.js Socket IO Test
var app = require('express').createServer(),
redis = require('socket.io/node_modules/redis'),
io = require('socket.io').listen(app);
var pub = redis.createClient(port, "url");
var sub = redis.createClient(port, "url");
var store = redis.createClient(port, "url");
pub.auth('pass', function(){console.log("adentro! pub")});
sub.auth('pass', function(){console.log("adentro! sub")});
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
# Replace any brackets with real values
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal
ssh [user]@[host]
cd ~
mkdir [mydomain_com].git
cd [mydomain_com].git
git init --bare
vi hooks/post-receive
# Enter the code from the "post-receive" file (in this gist); save + quit
@NeftaliYagua
NeftaliYagua / download.sh
Last active September 4, 2015 05:32 — forked from mildred/download.sh
Download from archive.org Wayback Machine
#!/bin/bash
url=http://redefininggod.com
webarchive=https://web.archive.org
wget="wget -e robots=off -nv"
tab="$(printf '\t')"
additional_url=url.list
# Construct listing.txt from url.list
# The list of archived pages, including some wildcard url
@NeftaliYagua
NeftaliYagua / pre_virtualhost_global.conf
Created April 10, 2018 19:45 — forked from WganMe/pre_virtualhost_global.conf
pre_virtualhost_global.conf
Header unset X-Powered-By
AddDefaultCharset UTF-8
AddLanguage en-US .html .htm .css .js
AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
#SetEnv SA Asia/Riyadh
Header set X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Security-Policy "allow 'self';"
Header set X-Content-Type-Options "nosniff"
ServerSignature Off
@NeftaliYagua
NeftaliYagua / gist:2632a6d5d01ce6a4f10348929850d4a1
Created April 10, 2018 19:51 — forked from igorparrabastias/gist:38f2ad11019612ad1573
Example of vhost configuration in Plesk based server
Example of vhost configuration in Plesk based server, in this case to disable SSLv2.
1) edit/create /var/www/vhosts/domain.com/conf/vhost.conf
2) only add the needed commands that you want overwrite:
### start ###
# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/vhosts/domain.com/httpdocs.production"
ServerName domain.com:443
@NeftaliYagua
NeftaliYagua / xfdf.php
Created March 3, 2020 14:41 — forked from collegeman/xfdf.php
Generate xFDF in PHP
<?php
/*
KOIVI HTML Form to FDF Parser for PHP (C) 2004 Justin Koivisto
Version 1.1
Last Modified: 2010-02-17
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.
@NeftaliYagua
NeftaliYagua / xfdf.php
Created March 3, 2020 15:51 — forked from stemwinder/xfdf.php
Converts array to xFDF XML format
<?php
/*
KOIVI HTML Form to FDF Parser for PHP (C) 2004 Justin Koivisto
Version 1.1
Last Modified: 2010-02-17
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.