Skip to content

Instantly share code, notes, and snippets.

View chaseconey's full-sized avatar

Chase Coney chaseconey

View GitHub Profile
@chaseconey
chaseconey / bootstrap-pagination.js
Created May 15, 2013 22:12
Simple extension for jquery datatables that outputs bootstrap compliant table structure. Use classes 'data-table table'...
$.fn.dataTableExt.oApi.fnPagingInfo = function (oSettings) {
return {
"iStart": oSettings._iDisplayStart,
"iEnd": oSettings.fnDisplayEnd(),
"iLength": oSettings._iDisplayLength,
"iTotal": oSettings.fnRecordsTotal(),
"iFilteredTotal": oSettings.fnRecordsDisplay(),
"iPage": oSettings._iDisplayLength === -1 ?
0 : Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
"iTotalPages": oSettings._iDisplayLength === -1 ?

install php

with mysql pgsql intl support

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl

set php timezone in php ini

date.timezone = Europe/Vienna
@chaseconey
chaseconey / vagrant.md
Last active December 19, 2015 17:38
Vagrant installation and use
@chaseconey
chaseconey / lesserKnownCommands.md
Created July 17, 2013 03:27
Some lesser known commands in *nix that I should totally use more....

Lesser Known Terminal Commands

This is just a reference for some commands and techniques that are not used that much and easily forgotten. These should be pretty universally available on OSX, Unix, and Linux.

pushd and popd

Command for keeping a queue of directories as you move around

	pushd ~/Downloads
@chaseconey
chaseconey / index.html
Created April 11, 2014 02:46
Angular Pagination and Search
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<!-- bower:css -->
<link rel="stylesheet" href="/bower_components/foundation/css/foundation.css" />
@chaseconey
chaseconey / README.md
Created April 24, 2014 02:40
Karma Setup

Karma Setup Snippets

This is the quick start to get up and running within something other than angular-seed, yeoman, etc. I am actually using these files within a laravel project, so all file paths will be relevant to that framework.

This

  • Runs in Chrome browser
  • Is setup for jenkins (junit reporting)

To run just do karma start in the root of the project

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
// The previous chapter introduced the standard function Math.min that returns its smallest argument. We can do that ourselves now. Write a function min that takes two arguments and returns their minimum.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
// We’ve seen that % (the remainder operator) can be used to test whether a number is even or odd by using % 2 to check whether it’s divisible by two. Here’s another way to define whether a positive whole number is even or odd:
@chaseconey
chaseconey / PjaxMiddleware.php
Created October 17, 2015 02:48 — forked from JeffreyWay/PjaxMiddleware.php
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@chaseconey
chaseconey / .osx
Created February 13, 2016 03:53
OSX Setup Script
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &