Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View brod-ie's full-sized avatar

Ryan Brodie brod-ie

View GitHub Profile
@brod-ie
brod-ie / Asynchronous PHP cURL
Last active December 20, 2015 20:18
This is the best method I've found for single asynchronous cURL's in PHP (great for calling external API's once your own has finished handling the request).
function acURL($url, $fields = array(), $method = 'POST')
{
# Set method
$cmd = "curl -X ".$method;
# Build fields
foreach ($fields as $key => $value) {
$cmd .= " -F '".$key."'='".$value."'";
}
@brod-ie
brod-ie / Slim.php
Last active December 20, 2015 20:49
`\Slim\View` class extension for use with the Mustache templating engine.
<?php
class Mustache extends \Slim\View
{
public function render($template)
{
$mustache = new \Mustache_Engine(
array(
'loader' => new Mustache_Loader_FilesystemLoader(__DIR__.'/'),
// ...
@brod-ie
brod-ie / example.sass
Created August 19, 2013 08:45
respond-to() SASS mixin for Bootstrap 3 grid system.
.profile-pic {
float: left;
width: 250px;
@include respond-to(xs) {
width: 100%;
}
@include respond-to(sm) {
width: 125px;
}
@brod-ie
brod-ie / compiled.css
Last active August 22, 2019 00:09
CSS cursor property helper
.cursor.auto {
cursor: auto !important;
}
.cursor.crosshair {
cursor: crosshair !important;
}
.cursor.default {
cursor: default !important;
@brod-ie
brod-ie / .aliases
Created February 10, 2014 15:46
Alias for easy `gulpfile.coffee` use with GulpJS
alias gulp='gulp $1 --require coffee-script/register'
@brod-ie
brod-ie / .osx
Created April 8, 2014 02:22
OS X: Save to disk (not to iCloud) by default
#!/bin/bash
# Ask for the administrator password upfront
sudo -v
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Kill finder
killall "Finder" > /dev/null 2>&1
#import "SafariServices/SafariServices.h"
// Init SFViewController with webpage that'll use the
// app's URL scheme to send result back to app
NSURL *url = [NSURL URLWithString:@"http://api.app.com/determine-auth-state"];
SFSafariViewController *sfvc = [[SFSafariViewController alloc] initWithURL:url];
// Configure to be hidden over existing VC
sfvc.view.hidden = YES;
sfvc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
@brod-ie
brod-ie / PulsingCTA.html
Created January 12, 2016 14:12
Pulsing Call To Action Tap Target
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
body, html {
height: 100%;
background: #fff;
}
@brod-ie
brod-ie / fixTheDock.sh
Created February 8, 2016 17:39
Stop the maddening OS X dock's autohide delay
#!/bin/bash
defaults write com.apple.dock autohide-time-modifier -int 0
defaults write com.apple.Dock autohide-delay -float 0
killall Dock
@brod-ie
brod-ie / styles.css
Created November 30, 2022 14:06
Figma Styles → Our Webflow CSS selectors
.red.fill,.red.fill.light{background:#ff3b30}.red.fill path[fill],.red.fill.light path[fill]{fill:#ff3b30}.red.fill path[stroke],.red.fill.light path[stroke]{stroke:#ff3b30}.red.fill.dark{background:#ff453a}.red.fill.dark path[fill]{fill:#ff453a}.red.fill.dark path[stroke]{stroke:#ff453a}.red.stroke,.red.stroke.light{color:#ff3b30}.red.stroke path[fill],.red.stroke.light path[fill]{fill:#ff3b30}.red.stroke path[stroke],.red.stroke.light path[stroke]{stroke:#ff3b30}.red.stroke.dark{color:#ff453a}.red.stroke.dark path[fill]{fill:#ff453a}.red.stroke.dark path[stroke]{stroke:#ff453a}.orange.fill,.orange.fill.light{background:#ff9500}.orange.fill path[fill],.orange.fill.light path[fill]{fill:#ff9500}.orange.fill path[stroke],.orange.fill.light path[stroke]{stroke:#ff9500}.orange.fill.dark{background:#ff9f0a}.orange.fill.dark path[fill]{fill:#ff9f0a}.orange.fill.dark path[stroke]{stroke:#ff9f0a}.orange.stroke,.orange.stroke.light{color:#ff9500}.orange.stroke path[fill],.orange.stroke.light path[fill]{fill:#ff9500}.