This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| perl -p -i -e 's/OLD/NEW/g' `grep -rl "OLD" .` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use Mojolicious::Lite; | |
| use EV; | |
| use AnyEvent; | |
| #use POSIX qw(strftime); | |
| use DDP; | |
| get '/' => sub { | |
| my $self = shift; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # mongodb Startup script for the mongodb server | |
| # | |
| # chkconfig: 2345 85 15 | |
| # description: MongoDB Database Server | |
| # | |
| # processname: mongodb | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set number | |
| """set smartindent | |
| set tabstop=4 | |
| """set shiftwidth=4 | |
| """set expandtab | |
| "define :Tidy command to run perltidy on visual selection || entire buffer" | |
| command -range=% -nargs=* Tidy <line1>,<line2>!perltidy | |
| " | |
| ""run :Tidy on entire buffer and return cursor to (approximate) original position" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package MyApp::Controller::Bar; | |
| use Mojolicious::Lite; | |
| get '/test' => sub { | |
| my $self = shift; | |
| $self->render('test'); | |
| }; | |
| 1; | |
| __DATA__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package My::UserAgent | |
| use Mojo::UserAgent; | |
| use Moo; | |
| has _ua => ( | |
| is => 'ro', | |
| lazy => 1, | |
| init_arg => 0, | |
| default => sub { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package WWW::XXXX; | |
| use Scalar::Util qw(looks_like_number); | |
| use Moo; | |
| has number => ( | |
| is => 'rw', | |
| isa => sub { die "$_[0] is not int" unless looks_like_number $_[0] }, | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| perl -d -e 1 |