Skip to content

Instantly share code, notes, and snippets.

View 1stevengrant's full-sized avatar
🏠
Working from home

Steven Grant 1stevengrant

🏠
Working from home
View GitHub Profile
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft
@fhferreira
fhferreira / haversine.php
Last active January 19, 2021 14:44
Haversine Method for model Laravel.
<?php
/*
* find the n closest locations
* @param Model $query eloquent model
* @param float $lat latitude of the point of interest
* @param float $lng longitude of the point of interest
* @param float $max_distance distance in miles or km
* @param string $units miles or kilometers
* @param Array $fiels to return
* @return array
@dennisfrank
dennisfrank / get_remote_db.sh
Created May 23, 2014 16:49
Shell script to import a remote database into local environment
#!/bin/sh
# Import a remote database into a local database
# ----------------------------------------------
#
# Based on http://danherd.net/quick-script-synchronise-from-a-remote-expressionengine-database/
#
# Don’t forget chmod +x to make the script executable.
#
# Change the extension to .command to run the script directly from OS X Finder.
@FrostyX
FrostyX / FacebookDebugger.php
Last active February 9, 2022 11:15
Facebook API - Force facebook to reload cache from your website
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
@djekl
djekl / stripe_sub_wo_cc.php
Created July 30, 2014 20:06
Laravel Cashier Free Subscription w/o Credit Card Filter
<?php
Route::filter('stripe.plans.free', function() {
if (Auth::guest() || Auth::user()->subscribed()) {
return;
}
$user = Auth::user();
$chosenPlan = 'free';
@aarongustafson
aarongustafson / lazy-loaded-markup.html
Last active March 8, 2018 09:35
Easy Responsive Images in ExpressionEngine with CE Image
<div class="module__image image--lazy"
data-image-src="Tim-Smith_220x140_220_140_int_c1.jpg"></div>
@adactio
adactio / Twig-critical-CSS-test.twig
Last active January 30, 2024 07:13
Twig template for inlining critical CSS on first visits.
{% set cssupdate = '20150309' %}
{% if _cookie.csscached == cssupdate %}
<link rel="stylesheet" href="/css/global-min.{{ cssupdate }}.css">
{% else %}
<style>
{% include 'global/critical.css' %}
</style>
<script>
(function (win, doc) {
'use strict';
@Topener
Topener / slack_invite.php
Last active June 26, 2022 03:05
Simple PHP script to invite slack users
<?php
/**
* This is a simple script to invite users to your slack
* Replace the subdomain and token in the variables below.
* Upload a logo called "logo.png" to the same directory for your group
* Upload a logo called "slack.png" to the same directory for slack
*/
define('SUBDOMAIN','{YOUR SUBDOMAIN HERE}');
define('TOKEN','{YOUR API TOKEN HERE}');
?>
@manuhabitela
manuhabitela / _grid.scss
Last active January 11, 2021 14:15
Making the Bootstrap grid with Susy and sass-mq
// this is (a start of) an example of a Susy+mq() setup that mimics bootstrap grid.
// I work on multiple bootstrap-based projects.
// I want to stop using grid classes in the markup, and start using mixins with susy and sass-mq.
// Since the project is heavily tied to the bootstrap grid, I want to have the exact same behavior
// between bootstrap classes (old code) and susy mixins (new code).
// all the grid classes generated below are here to ease up testing.
// required: susy + sass-mq