Skip to content

Instantly share code, notes, and snippets.

View Chintanvpatel's full-sized avatar

Chintan V. Patel Chintanvpatel

View GitHub Profile
<?php
class NIC_Controller_Plugin_Ssl extends Zend_Controller_Plugin_Abstract
{
public function preDispatch ( Zend_Controller_Request_Abstract $request )
{
$this->_secureUrl($request);
}
public function signupAction()
{
//echo $this->url()->fromRoute('home', array(), array('force_canonical' => true)); exit;
$form = new ApplicationForm();
$form->registerForm($this->getRequest()->getBaseUrl().'/data/captcha/');
//$form->get('multi-checkbox')->setOptions(array('value_options'=>array('4'=>'newone')));
//$form->get('multi-checkbox')->setValue(array('0','1'));
$form->get('submit')->setAttribute('value', 'Sign up');
//$form->get('user')->setAttribute('disabled', 'true');
// $form->get('gender')->setAttribute('disabled', 'true');
@Chintanvpatel
Chintanvpatel / spidigo_login.py
Created March 28, 2015 17:08
Spidigo login script
import urllib
import urllib2
import time
import sys
try:
login=sys.argv[1] # 0 -> logout 1-> login
except IndexError:
login = 1
gettimeofday({1498808668, 603740}, NULL) = 0
gettimeofday({1498808668, 603793}, NULL) = 0
access("/var/www/html/www.example.com/web/public/storage/framework/sessions/150b89cdd71e1632f429908c9bb75cb5ca508ea7", F_OK) = 0
gettimeofday({1498808668, 603917}, NULL) = 0
gettimeofday({1498808668, 603970}, NULL) = 0
gettimeofday({1498808668, 604032}, NULL) = 0
gettimeofday({1498808668, 604090}, NULL) = 0
gettimeofday({1498808668, 604145}, NULL) = 0
gettimeofday({1498808668, 604203}, NULL) = 0
gettimeofday({1498808668, 604264}, NULL) = 0
access("/var/www/html/www.example.com/web/public/storage/framework/sessions/1f56eda7d88187b5cdbd06595e35b65be04d09d6", F_OK) = -1 ENOENT (No such file or directory)
lstat("/var/www/html/www.example.com/web/public/storage/framework/sessions/9fb6894db60319062255be9236ec877b48723956", {st_mode=S_IFREG|0777, st_size=259, ...}) = 0
stat("/var/www/html/www.example.com/web/public/storage/framework/sessions/9fb6894db60319062255be9236ec877b48723956", {st_mode=S_IFREG|0777, st_size=259, ...}) = 0
access("/var/www/html/www.example.com/web/public/storage/framework/sessions/9fb6894db60319062255be9236ec877b48723956", F_OK) = 0
lstat("/var/www/html/www.example.com/web/public/storage/framework/sessions/d5bc2cca61b43562670536c59c7715c4dd96c2c3", {st_mode=S_IFREG|0777, st_size=259, ...}) = 0
stat("/var/www/html/www.example.com/web/public/storage/framework/sessions/d5bc2cca61b43562670536c59c7715c4dd96c2c3", {st_mode=S_IFREG|0777, st_size=259, ...}) = 0
access("/var/www/html/www.example.com/web/public/storage/framework/sessions/
@Chintanvpatel
Chintanvpatel / gist:4d80e708cfe6eb6aa84d3773ecffb692
Last active August 10, 2017 11:58 — forked from bryhal/gist:4129042
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY AUTO_INCREMENT,
db_date DATETIME NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
hour INTEGER NOT NULL, -- 0 to 23
UNIQUE td_ymd_idx (year,month,day,hour),
UNIQUE td_dbdate_idx (db_date)