Skip to content

Instantly share code, notes, and snippets.

View jamesmills's full-sized avatar

James Mills jamesmills

View GitHub Profile
@rodrigopedra
rodrigopedra / generate.php
Created April 17, 2022 04:22
PHP import CSV
<?php
$file = fopen('php://output', 'w');
fputcsv($file, ['ID', 'NAME', 'AGE']);
for ($index = 0; $index < 21_000_000; $index++) {
fputcsv($file, [$index + 1, bin2hex(random_bytes(20)), random_int(18, 65)]);
}
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class MakeAll extends Command
{
/**
* The name and signature of the console command.
*
@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active July 13, 2023 17:40
Laravel 5 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com', ])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{
@anthonysterling
anthonysterling / destroy-vagrant.sh
Created May 22, 2013 09:48
Finds all running Vagrant instances, recursively, from with in the current folder. It then shuts them down, deletes the VM, and removes the .vagrant file.
#!/usr/bin/env bash
for config in `find . -type f -name .vagrant`
do
uuid=`cat "$config" | php -r 'echo json_decode(fgets(STDIN))->active->default;'`
if VBoxManage showvminfo $uuid > /dev/null 2>&1; then
if VBoxManage showvminfo $uuid --machinereadable | egrep -q 'VMState="running|paused|stuck"'; then
VBoxManage controlvm $uuid poweroff
fi
VBoxManage unregistervm $uuid --delete
rm -f "$config"
@alexbilbie
alexbilbie / composer.json
Created October 14, 2012 16:16
OAuth2 client example
{
"require": {
"lncd/oauth2-facebook": "*",
"slim/slim": "2.*"
},
"minimum-stability": "dev"
}
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.