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 function setSentAttribute($value) { | |
if($value instanceof DateTime) | |
$value = $value->format('Y-m-d H:i:s'); | |
$this->attributes['sent'] = $value; | |
} |
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 namespace My\Namespace; | |
use Illuminate\Support\Facades\Route; | |
class Routes { | |
public static function all() { | |
static::allDevice(); | |
static::allPlatform(); |
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://stackoverflow.com/questions/20907068/how-to-create-a-strongly-typed-collection-that-only-contains-one-element-per-typ | |
class TypedSet<AbstractType> { | |
protected Dictionary<Type, AbstractType> data; | |
public TypedSet() { | |
data = new Dictionary<Type, AbstractType>(); | |
} | |
public void Add(AbstractType subclassOfAbstract) { |
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
using Nancy; | |
public class IndexModule : NancyModule { | |
// What would be neat is if I could teach Nancy new ways of handling the right side of routes. | |
public IndexModule() { | |
Get["/"] = typeof(MyProject.Controller.Home); | |
// This would perhaps run a standard method found on the class after instantiating it. |
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
# Quesedeals | |
General docs can be found here: | |
http://drupalcode.org/project/restws.git/blob_plain/d371e6e274d9f3ad15de1c2bf15e45874ce008d3:/README.txt | |
What follows is the guts of what you're after... | |
## Endpoints |
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 class BaseServiceClass | |
{ | |
protected static DictionaryType AllTheDataInTheWorld; | |
public BaseServiceClass() | |
{ | |
BaseServiceClass.AllTheDataInTheWorld = new DictionaryType(); | |
} | |
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 namespace BikeShed\Domain\Repository { | |
use BikeShed\Domain\User as UserModel; | |
interface User { | |
/** | |
* Searches Users without passwords by username. | |
* |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectCodeStyleSettingsManager"> | |
<option name="PER_PROJECT_SETTINGS"> | |
<value> | |
<option name="OTHER_INDENT_OPTIONS"> | |
<value> | |
<option name="INDENT_SIZE" value="4" /> | |
<option name="CONTINUATION_INDENT_SIZE" value="4" /> | |
<option name="TAB_SIZE" value="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
#!/bin/sh | |
echo "Configuring SSH Environment for `whoami`..." | |
rm -rf ~/.ssh | |
cp -r ~/.host-ssh ~/.ssh | |
chown -R root:root ~/.ssh | |
chmod -R 400 ~/.ssh | |
"$@" |
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 Illuminate\Routing\Controller; | |
use Illuminate\Foundation\Http\FormRequest; | |
// | |
use Illuminate\Http\Request; | |
/** | |
* | |
* Keep in mind, this uses a lot of idiomatic PHP. Any variable can be used as a nullable type and null |
OlderNewer