Skip to content

Instantly share code, notes, and snippets.

View coccoinomane's full-sized avatar
🎯
Focusing

coccoinomane coccoinomane

🎯
Focusing
View GitHub Profile
@vistik
vistik / JsonBodyRequest.php
Created March 16, 2015 12:06
Laravel 5 - Use form request to validate JSON body
<?php
namespace <YourNamespace>\Http\Requests;
// To validate the content of the JSON body instead of query params, you need to override the getValidatorInstance() method to create the validator instance with $this->json()->all() instead for $this->all()
// This way you can keep your Requests as is and just extend this class instead when you need to validate jsonbody instead of query params
abstract class JsonBodyRequest extends Request{
/**
@wookiecooking
wookiecooking / aliases.sh
Created November 30, 2013 00:52
[Shell] Assortment of OSX influenced bash aliases and functions
# Rails Stuff
alias stoprails='kill -9 $(lsof -i :3000 -t)'
alias startrails='rails server -d'
alias restartrails='stopRails && startRails'
#Check PHP For Erroes
alias phpcheck='find ./ -name \*.php | xargs -n 1 php -l'
# ROT13-encode text. Works for decoding, too! ;)
alias rot13='tr a-zA-Z n-za-mN-ZA-M'
@ooobo
ooobo / assignEditUrls.gs
Last active June 24, 2020 12:59
put edit response urls for google form in linked spreadsheet
// install as a google script linked to the form, not the spreadsheet. must add a trigger to run assignEditUrls() on form submit.
// benefit of linking to the form is that copying the spreadsheet will copy the spreadsheet, form and script.
function assignEditUrls() {
var form = FormApp.getActiveForm();
var ss = SpreadsheetApp.openById(form.getDestinationId());
var sheet = ss.getSheets()[0];
var data = sheet.getDataRange().getValues();
var urlCol = 2; // column number where URL's should be populated; A = 1, B = 2 etc
var responses = form.getResponses();
@fabrizim
fabrizim / gravity-ajax-fix.js
Created October 14, 2015 23:37
Gravity Forms: Prevent duplicate form submission on back button
jQuery(function($){
$(document).on('gform_post_render', function(e, form_id){
$('#gform_ajax_frame_'+form_id).attr('src', 'about:blank');
});
});
@siliconvallaeys
siliconvallaeys / Exclude Google Display Placements That Contain ...
Last active December 28, 2020 11:13
Automatically add negative placements for any new automatic GDN placements that include a particular piece of text
/****************************
* Add a Placement Exclusion When an Automatic Placement Contains the Text ...
* Version 1.0
*
* Created By: Frederick Vallaeys
* for FreeAdWordsScripts.com
* at the request of an Optmyzr.com subscriber
****************************/
function main() {
@derekmartinla
derekmartinla / google-display-network-placement-analyzer
Last active December 31, 2020 09:06
Google Display Network Placement Analyzer
/***********************************************************************************************
* AdWords Account Optimization - Review Google Display Network Site Placement Quality.
* Analyze Display Network Placements that have accrued more than $20 of cost MTD against
* Standard SEO metrics (PageAuthority, DomainAuthority, # of Backlinks, Age of Site) and report back
* Any questionable placements that are strong targets for exclusion.
* Created By: Derek Martin
* DerekMartinLA.com
****************************************************************************************/
// CONSTANTS
@a1phanumeric
a1phanumeric / gist:5346170
Created April 9, 2013 14:35
Grep exclusions. Demonstrates how to exclude multiple directories, and files.
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" .
@TylerFisher
TylerFisher / README.md
Last active July 13, 2021 18:48 — forked from onyxfish/README.md
Google Spreadsheets script to generate slugs from a range of cells

This script for Google Spreadsheets allows you to generate slugs for your data such as might be used for creating unique urls.

Use it like this!

# A B C
1 a b slug
2 foo baz bing =slugify(A2:B4)
3 bar BAZ
4 FOO baz-bing
@benlumley
benlumley / migrateorders.php
Created December 5, 2013 22:57
Script to migrate woocommerce orders from one wordpress database into another, along with associated data.
<?php
// Copies woocommerce orders and users over from source to target.
// I use this on my local machine - loading both db's up there side by side
// could easily adjust the connect strings to connect elsewhere if needed.
// will change order ids
// My use case for this is when I've got a staging/test version of a site with new posts/products/pages etc, that needs
// to go live without the loss of any orders placed on the site site since we copied it to the staging site.
@robinwarren
robinwarren / dashboard.html
Last active January 28, 2022 17:15
Trello dashboard using Bootstrap and JQuery
<html>
<head>
<title>A Trello Dashboard</title>
<link rel="stylesheet" media="screen" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Trello Dashboard</h1>
<form class="form-horizontal" id="boards_form">