Skip to content

Instantly share code, notes, and snippets.

View hskrasek's full-sized avatar

Hunter Skrasek hskrasek

View GitHub Profile
@hskrasek
hskrasek / AppointmentController.php
Created October 6, 2014 20:38
REST Route Ideas
<?php
class AppointmentController extends \BaseController {
public function index($id)
{
if ($id) {
$appts = $this->appointments->getAllForUser($id);
} else {
$appts = $this->appointments->getAll();

Keybase proof

I hereby claim:

  • I am hskrasek on github.
  • I am hunters (https://keybase.io/hunters) on keybase.
  • I have a public key whose fingerprint is 2E71 10B0 2D71 9CC4 FCA1 7B7F 7101 08C2 8416 B8B6

To claim this, I am signing this object:

<?php
$model = User::with('relation')->find(1);
$cloned = $model->replicate();
foreach($model->relation as $relation)
{
$cloned->relation()->save($relation);
}
@hskrasek
hskrasek / gist:03392a6f9d7b8cd2892d
Created August 7, 2014 16:31
Terry's interesting thing.
<?php
$user = new User;
$includes = "users,posts,comments";
call_user_func_array([$user, 'with'], explode(',', $includes));
$user->find(1);
>>> Installing Apache Server
!!! IP address not set. Check the Vagrant file.
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell
Stdout from the command:
>>> Installing Apache Server
$output = [];
foreach($stages as $key => $stage)
{
$output[$key] = $stage;
$output[$key][steps] = $stage->steps()->getResults()->toArray();
}
json_encode($output);
@hskrasek
hskrasek / gist:8278791
Created January 6, 2014 05:49
Laravel HHVM Composer Install Error
>>> Installing Laravel
Installing laravel/laravel (v4.1.0)
- Installing laravel/laravel (v4.1.0)
Downloading: 100%
read failed: Is a directory
read failed: Is a directory
read failed: Is a directory
Created project in /vagrant/laravel
Loading composer repositories with package information
@hskrasek
hskrasek / gist:5729592
Created June 7, 2013 14:19
Sublime Text 2 Config - Work
// User Settings
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"font_face": "Inconsolata",
"font_size": 14,
"ignored_packages":
[
"Vintage"
]
}
if $_GET["gamertag"] != null
{
//post code to the cgi-bin scripts with php somehow
//recieve the necessary data, and display it
//???
//profit
}