Skip to content

Instantly share code, notes, and snippets.

View it-can's full-sized avatar

M. Vugteveen it-can

View GitHub Profile
@it-can
it-can / ApiRespond.php
Created November 20, 2016 09:52 — forked from dugajean/ApiRespond.php
Trait for easy creation of API responses
<?php
namespace App\Traits;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
trait ApiRespond
{
/**
@it-can
it-can / supervisord.service
Last active June 22, 2017 20:09 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
package sri
import (
"crypto/sha256"
"encoding/base64"
"fmt"
"io/ioutil"
)
func Generate256(file string) (string, error) {
@it-can
it-can / pre-commit-dd
Last active May 22, 2016 12:24 — forked from martinbean/pre-commit
Pre-commit hook to detect if any files contain dd()
#!/usr/bin/php
<?php
function contains($needle, $haystack)
{
return stripos($haystack, $needle) !== false;
}
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD');
$files = explode("\n", trim($files));
@it-can
it-can / CacheRepository.php
Last active September 13, 2015 21:10 — forked from tillkruss/Database.php
[Laravel 5.1] Use Redis PECL/HHVM extension
<?php
namespace App\Repositories;
use Illuminate\Cache\Repository;
class CacheRepository extends Repository
{
public function has($key)
{
@it-can
it-can / Dnstransip.php
Last active August 29, 2015 14:26 — forked from lennartvdd/transip-dyndns.php
TransIP API DynDNS
<?php
// SETTINGS
// The domain to edit
define('DOMAIN', 'example.com');
// The authentication key
define('KEY', '69l67Le20e819360d3YHO1175');
// The DNS entries to update (name => content)
// This script will NOT add new entries

The Laracasts PHPStorm theme - modified.

This is a slightly modified version of the great Laracasts PHPStorm theme. I've added some styles for Verions Control (add, modified, deleted line...) and fixed some missing things like warnings.

Download

image

Mac: Add to ~/Library/Preferences/WebIde80/colors

<?php
/**
*
* This file contains a class which can be used to connect with the Exact Online API
*/
namespace ExactOnlineApi;
use \ExactOnlineApi\ApiException;
master_process on;
worker_processes 4;
worker_cpu_affinity 0001 0010 0100 1000;
worker_priority 0;
worker_rlimit_nofile 8192;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
@it-can
it-can / README.md
Created March 6, 2014 15:05 — forked from sj26/README.md

Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist.

If you use pow, echo 1080 > ~/.pow/mailcatcher and go to http://mailcatcher.dev, otherwise use http://localhost:1080.

Currently pow doesn't seem to pass websockets through correctly. Looking into this.