This file contains 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 Class::MOP; | |
use Config::ApacheFormat; | |
my $meta Class::MOP::Class->initialize( | |
'Config::ApacheFormat', | |
); | |
$meta->add_around_method_modifier('get', sub { | |
my $meth = shift; | |
my $self = shift; |
This file contains 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
# test.pl >> | |
use Config::ApacheFormat; | |
use Data::Dump 'dump'; | |
my $cfg = Config::ApacheFormat->new( | |
include_support => 1, | |
expand_vars => 1, | |
fix_booleans => 1, | |
duplicate_directives => "last", | |
); |
This file contains 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 Methods; | |
use strict; | |
use warnings; | |
use Keyword::API; | |
sub import { | |
my ($class, %params) = @_; | |
my $name = %params && $params{-as} ? $params{-as} : "method"; |
This file contains 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
#include <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct { | |
char *name; | |
int age; | |
int height; | |
int weight; |
This file contains 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
public abstract class ExtendedAppliance implements Appliance { | |
protected Double demand; | |
protected String name; | |
protected Integer id; | |
protected boolean turnedOn = false; | |
public Double demandUsedFor(Long seconds) { | |
if (turnedOn) | |
return (demand * (seconds / (3600))); |
This file contains 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
augroup filetype python | |
set softtabstop=4 | |
set shiftwidth=4 | |
set tabstop=4 | |
set smarttab | |
set expandtab | |
set autoindent | |
augroup END | |
" show hardcoded tabs and trailing ws |
This file contains 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
from pprint import pprint as pp; | |
import sys | |
class Foo(object): | |
def __init__(self, name): | |
print "building a Foo" | |
self.name = name | |
def sayhi(self): |
This file contains 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
### Features ### | |
# Create new feature branch | |
$ git feature new admin_html_pruning | |
# this executes the following for you | |
$ git checkout -b feature_admin_html_pruning | |
# create a new remote branch | |
git push -u origin feature_admin_html_pruning:feature_admin_html_pruning |
This file contains 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 backspace=indent,eol,start | |
set incsearch | |
set noshowmatch | |
nohlsearch | |
set ruler | |
set smartcase | |
syntax on | |
set softtabstop=4 | |
set shiftwidth=4 |
This file contains 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
@classmethod | |
def lookup(cls, uid=None): | |
lang = translation.get_language().replace('-', '_') | |
query = """ | |
START lang = node:Language(code:{lang}), | |
node = node:%s(uid:{uid}) | |
MATCH (node)-[:LANGUAGE]->(lang) | |
RETURN node | |
""" % (cls.__name__) | |
r = cls.category().cypher(query, {'uid': uid, 'lang': lang})[0] |
OlderNewer