Skip to content

Instantly share code, notes, and snippets.

View nedf23's full-sized avatar

Ned Fenstermacher nedf23

  • State College, PA
View GitHub Profile
@nedf23
nedf23 / app.blade.php
Created February 5, 2018 02:47
Default page layout that gets extended.
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
@hasSection('title')
@yield('title') - {{ config('app.name') }}
@else
vagrant package --base name_from_virtualbox --output name.box
INSERT INTO person_test
SELECT NULL,
ce.person_id,
ct.test_id,
ct.test_type_id,
ce.class_id,
sch.end_date,
DATE_ADD(sch.end_date, INTERVAL 30 DAY),
'date',
NULL,
select count(*)
from credit cr
join course c on c.course_id = cr.course_id
join person_work_unit pwu on pwu.person_id = cr.person_id
where c.course_type_id = 13
and pwu.work_unit_id != 72
and cr.completed_date >= '2017-09-01' and cr.completed_date <= '2017-10-01';
@nedf23
nedf23 / new_gist_file_0
Created March 28, 2017 12:01
Workbench SQL History Log
cd Library/Application\ Support/MySQL/Workbench/sql_history
grep -lr "text_goes_here" *
@nedf23
nedf23 / snippets
Last active March 28, 2017 13:09
Atom Snippets
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@nedf23
nedf23 / add_order_column_for_each_type.sql
Last active May 26, 2016 17:29
Adds a new column that auto numbers each row based off each type.
ALTER TABLE many_to_many ADD order_column INT;
CREATE TEMPORARY TABLE tmp_many_to_many AS (
SELECT many_to_many.id,
many_to_many.type_id,
(
CASE many_to_many.type_id
WHEN @type_id THEN @cur_row := @cur_row + 1
ELSE @cur_row := 1 AND @type_id := many_to_many.type_id
END
@nedf23
nedf23 / index.php
Created June 4, 2015 17:30
List folder files as links.
<?php
$uriToDir = '/downloads/clips';
$exclude = array(
'.',
'..',
'.DS_Store',
'index.php',
);
@nedf23
nedf23 / remove_tracked_files.sh
Created April 5, 2015 23:20
Removal files from repo.
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
@nedf23
nedf23 / ci_load.sublime-snippet
Created February 9, 2015 18:18
Sublime Snippet for CodeIgniter loading.
<snippet>
<content><![CDATA[
\$this->load->${1}('${2}'${3:, '${4}'});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cil</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html, source.php</scope>
</snippet>