Skip to content

Instantly share code, notes, and snippets.

View kylerberry's full-sized avatar

Kyler Berry kylerberry

View GitHub Profile
INSERT INTO `feature_flags` (`id`, `name`, `code`, `dependencies`, `conflicts`, `is_active`, `modified`)
VALUES
(UUID(), 'ZinHome.TopMenu', NULL, NULL, NULL, 1, now());
@kylerberry
kylerberry / HTML5 CSS Reset
Created July 30, 2014 04:20
HTML5 CSS Reset
/*
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@kylerberry
kylerberry / ng-api-templates
Created July 30, 2014 02:45
Angular Templates
//let's a make a housing listing app and a directive that repeats a template component
var app = angular.module('exampleApp', []);
app.controller('myCtrl', function($scope) {
$scope.listings = [
{
title: 'Quiet Apartment',
imgPath: 'images/apt.jpg',
desc: 'This is a description.'
@kylerberry
kylerberry / gist:5109102
Created March 7, 2013 16:02
jQuery: position:fixed Android Fix
<script>
$(document).ready( function() {
var fixedElement = $('.fixedElement');
$(window).resize(function(){
$(menu).remove();
$('body').append(fixedElement);
});
});
</script>
@kylerberry
kylerberry / Responsive Navigation
Last active December 14, 2015 09:39
Responsive Navigation: dropdown at small-screens, horizontal at larger screens
<!--
Based on code and examples by Terris Kremer
http://themetaq.com/articles/responsive-toggle-menu
-->
<!----------------------- html ----------------------->
<!-- //for wordpress navigation -->
<nav>
<h2 class="toggle-menu">Navigation<span></span></h2>
<?php wp_nav_menu(array('menu' =>'your_menu', 'menu_class' => 'navigation', 'container' => 'false')); ?>
$url = "http://www.example.org/";
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_URL, $url);
$data = curl_exec($curl);
curl_close($curl);
@kylerberry
kylerberry / gist:5005998
Created February 21, 2013 16:35
Kyle Schaeffer's Perfect jQuery AJAX Request
$.ajax({
type: 'POST',
url: 'http://kyleschaeffer.com/feed/',
data: { postVar1: 'theValue1', postVar2: 'theValue2' },
beforeSend:function(){
// this is where we append a loading image
$('#ajax-panel').html('<div class="loading"><img src="/images/loading.gif" alt="Loading..." /></div>');
},
success:function(data){
// successful request; do something with the data
@kylerberry
kylerberry / gist:4683759
Created January 31, 2013 15:37
Basic AJAX Request
<script type="text/javascript">
function prepareForm() {
var form = document.getElementsByTagName('form');
form[0].addEventListener('submit', function(e) {
e.preventDefault();
var queryString = '?';
document.getElementById('output').innerHTML = "";
//contains an array of all <input> elements
@kylerberry
kylerberry / Xcode:showDatabaseContents
Created October 15, 2012 23:11
Read from database and write to console
-(void)showDatabaseContents {
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [path objectAtIndex:0];
NSString *pathToDB = [documentsDirectory stringByAppendingString:@"/classes.sqlite"];
// NSString *pathToDB = [[NSBundle mainBundle] pathForResource:@"classes" ofType:@"sqlite"];
FMDatabase *db = [FMDatabase databaseWithPath:pathToDB];
@kylerberry
kylerberry / Simple CSS Template
Created October 10, 2012 17:13
A simple CSS template
@charset "UTF-8";
/*-----------------------------
IMPORT
------------------------------*/
@import url("css/reset.css");
/*-----------------------------
GLOBAL