Skip to content

Instantly share code, notes, and snippets.

@breezhang
breezhang / gist:11039674
Created April 18, 2014 11:44
install snipmeta vim plugin delay me many times !!!!!
A --> install snipmeta vim plugin
must be check https://github.com/garbas/vim-snipmate
""
We recommend one of the following methods for installing SnipMate and
its dependencies. SnipMate depends on vim-addon-mw-utils and tlib.
Since SnipMate does not ship with any snippets,
we suggest looking at the vim-snippets repository.
""
1. setup vundle
2.
@breezhang
breezhang / Perl Singleton Objects.pl
Created April 17, 2014 13:42
Perl Singleton Objects
use feature ":5.14";
use Scalar::Util qw{refaddr };
package BarSingleton;
my $this;
sub new {
if ( !$this ) {
$this = bless {}, shift;
@breezhang
breezhang / test3.pl
Created April 16, 2014 13:44
perl AOP attribute anothor ....
use strict;
use warnings;
{
package tools;
use Data::Dumper;
use Hook::LexWrap;
use Attribute::Handlers;
sub UNIVERSAL::Debug :ATTR(CODE) {
wrap $_[1], pre => sub { pop; print Dumper({'Pre' => \@_ })},
post => sub { pop; print Dumper({'Post' => \@_ })},
@breezhang
breezhang / test5.pl
Created April 16, 2014 13:43
perl Hook aop attribute demo. less Mosss .............
package main;
use strict;
use warnings;
use constant DEBUG => 1;
use Attribute::Handlers;
use Data::Dumper::Concise;
use Hook::LexWrap;
sub _log : ATTR(CODE) {
@breezhang
breezhang / test2.pl
Created April 16, 2014 13:42
perl attribute demo .......................
use strict;
use warnings;
use Data::Dumper::Concise;
use Scalar::Util qw/reftype/;
use constant DEBUG => 1;
use Attribute::Handlers;
sub _log : ATTR(CODE) {
@breezhang
breezhang / test8.pl
Created April 16, 2014 13:40
basic perl app
package myint;
use strict;
use warnings;
sub import {
$^H{"myint/in_effect"} = 1;
}
sub unimport {
$^H{"myint/in_effect"} = 0;
}
sub in_effect {
@breezhang
breezhang / test6.pl
Created April 16, 2014 13:03
Symbol Table References from camel
#
#Symbol Table References
#
use feature ":5.14";
use Scalar::Util qw(refaddr);
use Data::Dumper::Concise;
my $a1 =sub {
print "...............";
@breezhang
breezhang / t4.pl
Created April 15, 2014 02:48
log4perl Sample windows
use Log::Log4perl;
Log::Log4perl::init(\q{
###############################################################################
# Log::Log4perl Conf #
###############################################################################
log4perl.logger.my_app = DEBUG, LOG1
log4perl.appender.LOG1 = Log::Log4perl::Appender::File
log4perl.appender.LOG1.filename = C:\\my_app.log
log4perl.appender.LOG1.mode = append
@breezhang
breezhang / gist:10391972
Created April 10, 2014 15:06
win7 ftp issue
netsh advfirewall set global StatefulFTP disable
@breezhang
breezhang / gist:10224884
Created April 9, 2014 03:59
curl ...............code......................
--libcurl FILE