Skip to content

Instantly share code, notes, and snippets.

View jamesfinley's full-sized avatar

James Finley jamesfinley

View GitHub Profile
@jamesfinley
jamesfinley / .stylelintrc.json
Created February 22, 2023 12:08
A Stylelint for ordering your properties and keeping things clean.
/* You'll need the following packages: stylelint, stylelint-config-standard, stylelint-order */
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-order"
],
"rules": {
"length-zero-no-unit": [true, {"ignore": ["custom-properties"]}],
"property-no-vendor-prefix": null,
@jamesfinley
jamesfinley / WFSimulate3DTouchPreview.m
Last active November 1, 2016 15:41 — forked from nickfrey/WFSimulate3DTouchPreview.m
Test 3D Touch peek/pop using private APIs
@interface UIPreviewForceInteractionProgress : NSObject
- (void)endInteraction:(BOOL)arg1;
@end
@interface UIPreviewInteractionController : NSObject
@property (nonatomic, readonly) UIPreviewForceInteractionProgress *interactionProgressForPresentation;
@jamesfinley
jamesfinley / Checkbox Trick
Last active December 20, 2015 10:09
The problem with a checkbox field is that it only has one value and that value is only sent when it is checked. Optimally, it would have an on and off value. To compensate for that, I include a hidden field before the checkbox, with the same name, that contains the off value. When the checkbox is checked, the checkbox value is sent. When it is u…
<input type="hidden" name="show_pictures" value="0" />
<input type="checkbox" id="show_pictures_field" name="show_pictures" value="1" />
<label for="show_pictures_field">Show Pictures</label>
@jamesfinley
jamesfinley / gist:5540742
Created May 8, 2013 14:17
Share with Pinbook (with callback)
ashes://addOpenURL?title=Share%20with%20Pinbook&url=pinbook%3A%2F%2Fx-callback-url%2Fadd%3Furl%3D%5B%5B%5Burl%5D%5D%5D%26title%3D%5B%5B%5Btitle%5D%5D%5D%26x-source%3DAshes%26x-success%3D%5B%5B%5Bcallback%5D%5D%5D%26x-cancel%3D%5B%5B%5Bcallback%5D%5D%5D
@jamesfinley
jamesfinley / gist:5529801
Created May 7, 2013 02:08
Save to Kippster
ashes://addOpenURL?title=Save%20to%20Kippster&url=kippster%3A%2F%2Fx-callback-url%2Fadd%3Furl%3D%5B%5B%5Burl%5D%5D%5D%26x-success%3D%5B%5B%5Bcallback%5D%5D%5D%26x-cancel%3D%5B%5B%5Bcalback%5D%5D%5D
@jamesfinley
jamesfinley / gist:3933473
Created October 22, 2012 19:15
Getting SASSY
// Creating Variables
$green: #76c044;
// Using Variables
h1 {
color: $green;
}
// Math
h1 {
@jamesfinley
jamesfinley / gist:3287735
Created August 7, 2012 17:46
Fix for YouVersion
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="eng" lang="eng">
<head>
<title>YouVersion</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name = "viewport" content = "user-scalable = no">
<style type="text/css">
body { font-family: 'Helvetica Neue',Helvetica,Verdana,sans-serif; font-size: 17pt; }
.note {
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once('application/libraries/Admin_Controller.php');
class Projects extends Admin_Controller {
//controller
public $controller_path = 'admin/projects';
//module and model
$gray: #ccc;
$grey: $gray;
@jamesfinley
jamesfinley / gist:1274546
Created October 10, 2011 03:00
Simple template controller
<?php
$template = array();
$template['routes'] = array(
'(?P<slug>[a-z0-9\-])' => 'view',
'(?P<slug>[a-z0-9\-])/comment' => 'create_comment',
'default_action' => 'index'
);