Skip to content

Instantly share code, notes, and snippets.

View shardiwal's full-sized avatar

Rakesh Kumar Shardiwal shardiwal

  • Fagbokforlaget V&B AS
  • Gurgaon, Haryana
View GitHub Profile
@shardiwal
shardiwal / Way2sms.pm
Created July 27, 2011 08:54
API to send sms via Way2SMS.com
package Way2sms;
use Moose;
use LWP::UserAgent;
use HTTP::Cookies;
has 'username' => (
is => 'rw',
isa => 'Str',
package Alert;
use Moose;
has 'type' => (
is => 'ro',
isa => 'Str',
required => 1,
);
@shardiwal
shardiwal / Fullonsms::Message.pm
Created August 3, 2011 07:34
API to Send SMS from FullonSMS.com
package Fullonsms::Message;
use Moose;
use Fullonsms::Util;
has 'receiver_mobile_no' => (
is => 'rw',
isa => 'ArrayRef',
required => 1
);
@shardiwal
shardiwal / User.pm
Created August 4, 2011 05:44
doubt
package User;
use Moose;
use TypeConstraints qw/Gender DOB MySQLTimestamp/;
use DateTime;
use Date::Manip;
use DateTime::Format::MySQL;
has 'id' => (
@shardiwal
shardiwal / schedule-t20.pl
Created October 6, 2011 09:40
Indian T20 Practice Schedule
#!/usr/bin/perl
# Have a look this for the problem
#https://docs.google.com/document/d/1TyPFlDh--yp5q_NPPHX_Yd1iuUhIoZOH0hHSTabqAZw/edit?hl=en_GB&pli=1
use strict;
use warnings;
use Getopt::Std;
use DateTime;
@shardiwal
shardiwal / postconf_diff.sh
Created November 4, 2011 13:00 — forked from robinsmidsrod/postconf_diff.sh
Show Postfix configuration variables different from default
#!/bin/bash
postconf -d >/root/postfix.defaults
postconf >/root/postfix.conf
diff -u /root/postfix.defaults /root/postfix.conf | grep -v '^ '|grep -v '^@' |grep -v '^---' | grep -v '^+++'
// flash app needs time to load and initialize
if (RecorderFlash.recorder && RecorderFlash.recorder.init) {
RecorderFlash.recorderOriginalWidth = RecorderFlash.recorder.width;
RecorderFlash.recorderOriginalHeight = RecorderFlash.recorder.height;
if (RecorderFlash.uploadFormId && $) {
var frm = $(RecorderFlash.uploadFormId);
if (frm.size() > 0) {
RecorderFlash.recorder.configure(22,0,10,100);
RecorderFlash.recorder.setUseEchoSuppression('yes');
RecorderFlash.recorder.init(frm.attr('action').toString(),RecorderFlash.uploadFieldName,frm.serializeArray());
package Model::Calculation::PhysicalActivity;
use Dancer ':syntax';
use Dancer::Plugin::DBIC;
use Moose;
use Data::Dumper;
use Model::Response;
@shardiwal
shardiwal / sanitize_email
Last active August 29, 2015 14:10
sanitize email.php
function sanitize_email( $content ) {
$data = array();
foreach ( ( explode(' ',$content) ) as $address) {
$email = filter_var($address,FILTER_VALIDATE_EMAIL);
if ( $email ) {
$email = preg_replace('/\./', '[dot]', $email);
$email = preg_replace('/\@/', '[at]', $email);
$data[] = $email;
}
else {
2015-02-02 17:09:57,896 [ 8727] [ERROR] [bom-feed-listener-random.pl] [App/Base/Daemon.pm:346] Shutting down: Connection error: 500 Internal Server Error at /home/git/regentmarkets/cpan/local/lib/perl5/CouchDB/Client/Doc.pm line 85.
CouchDB::Client::Doc::retrieve(CouchDB::Client::Doc=HASH(0x4900428)) called at /usr/share/perl5/BOM/Platform/Data/CouchDB/Connection.pm line 172
BOM::Platform::Data::CouchDB::Connection::try {...} () called at /home/git/regentmarkets/cpan/local/lib/perl5/Try/Tiny.pm line 81
eval {...} called at /home/git/regentmarkets/cpan/local/lib/perl5/Try/Tiny.pm line 72
Try::Tiny::try(CODE(0x8910e28), Try::Tiny::Catch=REF(0x8931cc0)) called at /usr/share/perl5/BOM/Platform/Data/CouchDB/Connection.pm line 180
BOM::Platform::Data::CouchDB::Connection::document(BOM::Platform::Data::CouchDB::Connection=HASH(0x88f3aa8), "RDYIN") called at /usr/share/perl5/BOM/Platform/Data/CouchDB.pm line 205
BOM::Platform::Data::CouchDB::document(BOM::Platform::Data::CouchDB=HASH(0x8915ee8), "RDYIN") cal