Let's say you have a file like this:
<?php
declare(strict_types=1);
class Foo
{
protected $x;
public function __construct(array $x = [])
/** | |
* Pushover plugin for the uptime project - https://github.com/fzaninotto/uptime | |
* Thanks to DMathieu for the Campfire plugin which I basically hacked up to make this | |
* work: https://gist.github.com/dmathieu/5592418 | |
* | |
* This index.js files goes to a directory `plugins/pushover` in your installation of uptime. | |
* | |
* Notifies all events (up, down, paused, restarted) to pushover | |
* | |
* This plugin has a dependency on `pushover-notifications`. |
Let's say you have a file like this:
<?php
declare(strict_types=1);
class Foo
{
protected $x;
public function __construct(array $x = [])
source 'https://rubygems.org' | |
gem 'ruby-jmeter', github: 'lukeck/ruby-jmeter' |
#!/bin/sh | |
frames=( "(╮°-°)╮ ┳━┳" "(╯°o°)╮ ┳━┳" "(╯°o°)╯ ︵ ╡" "(╯°o°)╯ ︵┻━┻" "(╮°□°)╮ ┻━┻" ); | |
for frame in "${frames[@]}"; do | |
printf "%s\033[0K\r" "${frame}"; | |
sleep 0.5; | |
done |
If you were learning graph algorithms, which approach would you prefer:
Imagine you have to take public transit from your home to your office. How do you figure out the fastest route? Use graph algorithms! OR
We can choose between two standard ways to represent a graph G = (V, E): as a collection of adjacency lists or as an adjacency matrix. Either way applies to both directed and undirected graphs.
I prefer the first way: lead with lots of examples, and clear writing. The second way is an excerpt from "Introduction to Algorithms"...that's how they start their section on graph algorithms.
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
A Symfony command to convert from NelmioApiDocBundle annotations to Swagger-PHP annotations.
This code is provided as is. Make sure to have your code committed to version control before running the command. Check if things work out and if not, use version control to reset the automated changes and fix the command.
#!/usr/bin/env php | |
<?php | |
include_once 'app/global_vars.php'; | |
require ROOT_DIR . 'vendor/autoload.php'; | |
use Application\Command\InsertFixturesCommand; | |
use Symfony\Component\Console\Application; |
{ | |
"builders": [{ | |
"type": "amazon-ebs", | |
"access_key": "", | |
"secret_key": "", | |
"region": "us-east-1", | |
"source_ami": "ami-de0d9eb7", | |
"instance_type": "m1.large", | |
"ssh_username": "ubuntu", | |
"ami_name": "packer-jenkins {{.CreateTime}}" |