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 FlashMessages { | |
private $messages = array(); | |
private $now = false; | |
private static $instance = null; | |
private function __construct() { | |
// Save all messages | |
$this->messages = $_SESSION['flash_messages']; |
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 DocBlock { | |
public $docblock, | |
$description = null, | |
$all_params = array(); | |
/** | |
* Parses a docblock; |
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
# Baylor Rae's Prompt Theme | |
# based on wunjo prompt theme and modified for oh-my-zsh | |
# shows me all files and folders when I change directories | |
cd() { builtin cd "$@"; ls } | |
# uses ~ instead of /Users/baylorrae/ | |
pwd() { print -D $PWD } | |
# I substituted my own so the commit times were live |
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, { useState, useEffect } from 'react'; | |
import './App.css'; | |
import { firebase } from './config' | |
function useTimesList(sortDirection='asc') { | |
const [times, setTimes] = useState([]) | |
useEffect(() => { | |
const unsubscribe = firebase |
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
// http://obvcode.blogspot.com/2007/11/easiest-way-to-check-ie-version-with.html | |
var Browser = { | |
version: function() { | |
var version = 999; // we assume a sane browser | |
if (navigator.appVersion.indexOf("MSIE") != -1) { | |
// bah, IE again, lets downgrade version number | |
version = parseFloat(navigator.appVersion.split("MSIE")[1]); | |
} | |
return version; |
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
def test_ordered_reducer_pattern(): | |
class RandomNumberDependency(Dependency): | |
def promises(self): | |
return ['random-number'] | |
def execute(self, context): | |
context['random-number'] = 5 | |
return context |
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 PubSub { | |
private static $events = array(); // all subscriptions | |
// Don't allow PubSub to be initialized outside this class | |
private function __construct() {} | |
private function __clone() {} | |
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
" 1) W isn't mapped by default | |
command! W :w | |
" 2) force minimun window width | |
set winwidth=110 | |
" 3) navigate by display lines | |
noremap j gj | |
noremap k gk |
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
module Types | |
ProjectType = GraphQL::ObjectType.define do | |
name "Project" | |
description "a project" | |
implements GraphQL::Relay::Node.interface | |
global_id_field :id | |
field :title, !types.String do |
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
Feature: purchase product | |
Scenario: purchase product | |
Given seller has created a product | |
When buyer purchases the product | |
And buyer sends payment | |
Then seller should receive money | |
And the product shouldn't be listed |
NewerOlder