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
### | |
A set of functions to tokenize a string. | |
`lexer` is meant to be the entry point to analyse a string. It takes two | |
parameters, a string containing code and an associated (file) name, and returns | |
the created set of tokens. | |
The set of tokens returned by `lexer` is aggregated in `tokenize`, which is | |
called initially with the result of `initialToken`. This is necessary for the |
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
~/p/d/a/ldap_server master $ ldapsearch -H 'ldap://localhost:4040/' -D 'a' -b 'dc=foo,dc=example,dc=com' '(foo=bar)' a | |
ldap_bind: Success (0) | |
matched DN: a | |
additional info: Authenticated! | |
# extended LDIF | |
# | |
# LDAPv3 | |
# base <dc=foo,dc=example,dc=com> with scope subtree | |
# filter: (foo=bar) | |
# requesting: a |
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
# Add this profile to be able to define a list of further profiles to include | |
# in hieradata. | |
# | |
# This lets you compose a role with other profiles to create "very special | |
# snowflake" configurations. | |
class profile::snowflake { | |
$profiles = hiera_array('profiles::include', []) | |
contain $profiles | |
} |
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
$ function fish_prompt; set_color white; echo -n $USER:(echo $PWD | sed -e "s|$HOME|~|"); set_color normal; echo -n ' $ '; end | |
apanek: ~/blog $ funcsave fish_prompt |
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
# bundle exec rspec | |
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -S rspec spec/classes/bond/setup_spec.rb spec/defines/bond/debian_spec.rb spec/defines/bond/redhat_spec.rb spec/defines/bond_spec.rb spec/unit/network_facts_spec.rb spec/unit/provider/network_config/interfaces_spec.rb spec/unit/provider/network_config/redhat_spec.rb spec/unit/provider/network_route/redhat_spec.rb spec/unit/provider/network_route/routes_spec.rb spec/unit/type/network_config_spec.rb spec/unit/type/network_route_spec.rb --color | |
...............FFFF.FF...................................................................................................................................................................................................**.*.***....................................... | |
Pending: | |
Puppet::Type::Network_config when validating the attribute options should be a descendant of the KeyValue property | |
# on conversion to specific type | |
# ./spec/unit/type/network_config_spec.rb:69 |
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
with_defaults = (object, defaults) -> | |
f = (previous, current) -> | |
unless Object.hasOwnProperty(previous, current) | |
previous[current] = object[current] | |
previous | |
Object.keys(object).reduce f, defaults | |
# "Fancy" version of Object.defineProperty that stores and applies a given |
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 std::iter::Range; | |
fn main() { | |
println!("I am such a great program. I can count to ten.") | |
let start = 1; | |
let stop = 10; | |
start = 2; | |
for i in natural_range(start, stop) { |
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
# Ensure given object implements methods and has properties according to the | |
# given interface. | |
# | |
# An interface may look as follows: | |
# | |
# DuckType = { | |
# getFoo: 'function', # Expect function foo | |
# setFoo: [ 'function', 3 ], # Expect function bar, taking at least 3 arguments | |
# bar: 'property', | |
# boo: [ 'property', 'string' ] |