Skip to content

Instantly share code, notes, and snippets.

View snipe's full-sized avatar
😩
So jetlag. Much tired.

snipe snipe

😩
So jetlag. Much tired.
View GitHub Profile
@TvL2386
TvL2386 / scheduler.php
Last active January 8, 2018 04:53
my scheduler
$ php artisan schedule:daemon
[2018-01-07 12:11:24] Starting schedule:daemon
[2018-01-07 12:11:24] Waiting for next minute
[2018-01-07 12:12:00] running main loop
Running scheduled command: App\Jobs\CreateSnapshot
[2018-01-07 12:13:00] running main loop
Running scheduled command: App\Jobs\CreateSnapshot
[2018-01-07 12:14:00] running main loop
Running scheduled command: App\Jobs\CreateSnapshot
[2018-01-07 12:15:00] running main loop
@graceavery
graceavery / harryPotterAliases
Last active May 10, 2023 02:51
bash aliases for Harry Potter enthusiasts
alias accio=wget
alias avadaKedavra='rm -f'
alias imperio=sudo
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"'
alias stupefy='sleep 5'
alias wingardiumLeviosa=mv
alias sonorus='set -v'
alias quietus='set +v'
@CatoTH
CatoTH / HTMLValidator.php
Last active May 24, 2017 07:52
A helper class for Codeception that allows automated HTML5 Validation using the Nu Html Checker during acceptance testing. It uses local binaries and can therefore be run offline.
<?php
/**
* A helper class for Codeception (http://codeception.com/) that allows automated HTML5 Validation
* using the Nu Html Checker (http://validator.github.io/validator/) during acceptance testing.
* It uses local binaries and can therefore be run offline.
*
*
* Requirements:
* =============
@tabacitu
tabacitu / gist:dbcfd71375e72c857474
Last active April 20, 2020 09:05
Tabacitu Laravel Package Service Provider boilerplate code
<?php
namespace League\Skeleton;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
class SkeletonServiceProvider extends ServiceProvider
{
/**
@Kreshnik
Kreshnik / PreventReplayAttack.php
Last active March 29, 2022 11:00
Laravel 5 - PreventReplayAttack Middleware
<?php namespace App\Http\Middleware;
use Carbon\Carbon;
use Closure;
use Illuminate\Cache\Repository as Cache;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Session;
class PreventReplayAttack
{
@fillup
fillup / google-example.php
Last active November 30, 2022 08:08
Example of using Google Admin SDK Directory API to get an individual or list of users.
<?php
// Updated 2018-01-24 to work with google/apiclient:^2.0
/*
* Easiest to use composer to install google-api-php-client and generate autoloader
* If you dont want to use composer you can manually include any needed files
*/
include_once 'vendor/autoload.php';
/*
* Email address for admin user that should be used to perform API actions
Install Snipe-IT Windows 2008 R2 With IIS
Prereq (Install all of these prior to continuing)
IIS
IIS URL Rewrite
PHP 5.3 for Windows Server via WPM (http://www.microsoft.com/web/platform/phponwindows.aspx)
MariaDB 5.5 for Windows Server 64-bit (https://downloads.mariadb.org/interstitial/mariadb-5.5.37/winx64-packages/mariadb-5.5.37-winx64.msi/from/http://mirror.jmu.edu/pub/mariadb) | 32-bit (https://downloads.mariadb.org/interstitial/mariadb-5.5.37/win32-packages/mariadb-5.5.37-win32.msi/from/http://mirror.jmu.edu/pub/mariadb)
PHP Manager for IIS (makes managing PHP on IIS much easier) (http://phpmanager.codeplex.com/)
Composer install with the shell menus (https://getcomposer.org/Composer-Setup.exe )
Notepad++ for editing files (http://www.notepad-plus-plus.org/download/v6.6.6.html )
@oilop9000
oilop9000 / DbmigrateController.php
Last active August 5, 2020 20:05 — forked from bruceoutdoors/DbmigrateController.php
Laravel 4 Convert existing MySQL database to migrations. This is a fork of Lee Zhen Yong https://gist.github.com/bruceoutdoors/9166186 fork from Christopher Pitt's work http://laravelsnippets.com/snippets/convert-an-existing-mysql-database-to-migrations, which is based off michaeljcalkins's work at http://paste.laravel.com/1jdw#sthash.0nEgQzQR.dpuf
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table
@magnetikonline
magnetikonline / README.md
Last active November 27, 2023 21:12
Setting Nginx FastCGI response buffer sizes.
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select