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
Vagrant.configure("2") do |config| | |
config.vm.box = "precise32" | |
config.vm.box_url = "http://files.vagrantup.com/precise32.box" | |
config.vm.network :public_network | |
config.vm.provision :shell, :path => "deploy-puppet.sh" | |
config.vm.provision :puppet do |puppet| | |
puppet.module_path = "modules" | |
puppet.manifests_path = "manifests" | |
end | |
end |
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
function! RunNetGrep(pattern, ...) | |
let tmpfile = tempname() | |
if exists('g:NetGrep_server_name') && exists('g:NetGrep_default_directory') | |
let server_name = g:NetGrep_server_name | |
let default_directory = g:NetGrep_default_directory | |
else | |
echom "Error: NetGrep requires g:NetGrep_server_name and g:NetGrep_default_directory" | |
return | |
endif |
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
function! OpenQuickList(data) | |
silent! botright 10split __QuickList__ | |
normal! ggdG | |
setlocal buftype=nofile | |
setlocal bufhidden=delete | |
setlocal noswapfile | |
setlocal nowrap | |
setlocal nobuflisted |
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
<?php | |
class SomeClass { | |
public function do_something( $times ) { | |
$user = wp_get_current_user(); | |
//... | |
return true; | |
} | |
} |
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
import React from 'react'; | |
const Header = () => <div className="header"><img className="header__logo" src="/assets/logo.png" /><h1 className="header__title">My App</h1></div>; | |
const ToDoList = () => <div className="to-do-list"><h2 className="to-do-list__title">To Do</h2></div>; | |
const Controls = () => <div className="controls"><h2 className="controls__title">Controls</h2></div>; | |
const Footer = () => <div className="footer">Made by Me</div>; | |
export default React.createClass( { | |
render() { | |
return ( |
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
<?php | |
require_once( 'get-deep-value.php' ); | |
/** | |
* @runTestsInSeparateProcess | |
*/ | |
class Get_Deep_Value_Test extends PHPUnit_Framework_TestCase { | |
use Codeception\Specify; |
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
var getWindow = require( './window' ).getWindow; | |
function getSomethingFromTheDOM() { | |
return getWindow().document.querySelector( '.something' ); | |
} |
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 up DOM | |
var jsdom = require( 'jsdom' ).jsdom; | |
global.document = jsdom( '' ); | |
global.window = document.defaultView; | |
global.navigator = document.defaultView.navigator; | |
// Prepare React | |
var ReactTestUtils = require( 'react-addons-test-utils' ); | |
var React = require( 'react' ); |
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
<?php | |
class GreetingGenerator { | |
public function get_greeting( $name ) { | |
// Assumes determine_greeting is defined in another file | |
return determine_greeting( $name ); | |
} | |
} | |
class Greeter { |
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
<?php | |
use PHPUnit\Framework\TestCase; | |
class MyTime { | |
/** | |
* Convert a float string timezone offset to a DateTimeZone | |
* | |
* @param string $number The initial offset float, as a string. | |
* @return DateTimeZone The converted DateTimeZone | |
*/ |