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
$info = [
'deal' => [
'name' => 'Plan Name',
'amount' => 100,
'stage_name' => 'won',
'closed_date' => '2017-06-02',
'deal_stage_id' => 'DEAL-STAGE-ID',
'sales_account' => [
'name' => 'Account Name',
'website' => 'http://example.org'
@snipe
snipe / googleform2email
Last active November 16, 2017 21:37
Script to get the contents of a Google form submission emailed to you.
function sendFormByEmail(e)
{
// Remember to replace this email address with your own email address
var email = "you@example.com";
var s = SpreadsheetApp.getActiveSheet();
var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0];
var message = "";
var subject = "New Hire: ";
@snipe
snipe / profanity
Last active January 4, 2018 04:49
PHP Profanity Filter Sample Script
This script is now available at banbuilder.com or https://github.com/snipe/banbuilder
@snipe
snipe / gist:936bf578fea346e0c16845a7146d7f59
Last active March 23, 2018 23:04
Snipe-IT tinker cached .env recover for wiped file
# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=production
APP_DEBUG=false
APP_KEY=ChangeMe
APP_URL=null
APP_TIMEZONE='UTC'
APP_LOCALE=en
@snipe
snipe / gist:14752d829bd3490a2d0a
Created February 21, 2015 05:05
CALL TO UNDEFINED METHOD ILLUMINATE\COOKIE\COOKIEJAR::GET() in Laravel 4.2
Upgrade Sentry to v 2.1.*
@snipe
snipe / build-ant-phpunit
Created November 22, 2012 21:08
Apache Ant build.xml file for PHPUnit+Jenkins+Ant+Zend Framework
<?xml version="1.0" encoding="UTF-8"?>
<!-- Set some basic project information and targets -->
<project name="My ZF Project" default="build">
<target name="build"
depends="prepare, lint, phploc, phpmd, phpcpd, phpcs, phpunit"/>
<target name="build-parallel"
depends="prepare,lint, tools-parallel, phpcpd, phpunit"/>
@snipe
snipe / dqh+aws
Last active September 11, 2019 15:06
DeployHQ+AWS Autoscalers
#!/bin/bash
# Set these variables
USER_NAME="you@example.com"
API_KEY="XXXXXXXX_YOUR_DHQ_API_KEY_XXXXXXXXXXXXX"
START_REV='SOME_ARBITRARY_GIT_REVISION_HASH_TO_START_FROM'
DHQ_API_PROJ="your-project-shortname"
DHQ_BASE_URL="https://yoursite.deployhq.com/"
DHQ_SERVER_GROUP="YOUR_SERVER_GROUP_UUID"
DHQ_SERVER_USERNAME="your-server-username"
@snipe
snipe / AppServiceProvider.php
Last active February 13, 2020 11:16
Validate email array in Laravel 5.2 wth custom validator
<?php
/**
* This service provider handles a few custom validation rules.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v3.0
*/
namespace App\Providers;
@snipe
snipe / htaccess-ip-lock
Created November 6, 2012 03:51
Htaccess to handle IP whitelisting, password prompt otherwise
# Welcome to your htaccess file.
# Remember that modifying this file can break the entire website
# so please edit carefully.
# Also remember that the order of the rules below does matter,
# so be sure of what you're doing before shuffling things around.
AuthType Basic
AuthName "My Dev Environment"
# Specify what user/password file the server should look
@snipe
snipe / fizzbuzz
Last active February 6, 2022 17:15
By request, a PHP fizzbuzz that prints the numbers from 1 to 100. But for multiples of three print “Fuck You” instead of the number and for the multiples of five print “Choke on a Bag of Dicks”. For numbers which are multiples of both three and five print “Fuck You Choke on a Bag of Dicks”.
foreach (range(1,100) as $i)
echo (''==($x=($i%3==0?"Fuck You ":"").($i%5==0?"Choke on a Bag of Dicks":""))?$i:$x)."\n";