Skip to content

Instantly share code, notes, and snippets.

@bbatsche
bbatsche / 01.cmake
Last active August 29, 2015 14:28
brew install hhvm --verbose Error Logs
2015-08-24 11:19:16 -0500
cmake
.
-DBOOST_INCLUDEDIR=/usr/local/opt/boost/include
-DBOOST_LIBRARYDIR=/usr/local/opt/boost/lib
-DCCLIENT_INCLUDE_PATH=/usr/local/opt/imap-uw/include/imap
-DCMAKE_C_FLAGS=-I/usr/local/opt/readline/include -L/usr/local/opt/readline/lib
-DCMAKE_CXX_FLAGS=-I/usr/local/opt/readline/include -L/usr/local/opt/readline/lib
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/hhvm/3.9.0
$(document).ready(function() {
$(".collapse-column").each(function() {
$(this).data('default-height', $(this).height());
$(this).height('80');
});
$(".collapse-column").click(function() {
var targetHeight = $(this).data('default-height');
@bbatsche
bbatsche / laravel-ajax.php
Created October 15, 2014 20:06
Ajax Request
{{ link_to_action('PostsController@edit', 'Edit', $post->id, array('class' => 'btn btn-default')) }}
<button type="button" class="btn btn-danger delete-btn" data-post-id="{{{ $post->id }}}">Delete</button>
<script>
var csrfToken = "{{{ Session::get('_token') }}}";
$(".delete-btn").click(function() {
var postId = $(this).data('post-id');
if (confirm('Are you sure you want to delete this post?')) {
@bbatsche
bbatsche / jquery.data.html
Created September 29, 2014 22:50
Demonstrate getting & setting data attributes of an element
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JQuery, YAY!</title>
</head>
<body>
<h1 id="heading" data-alt-heading="MAGIC">Example Page</h1>
<?php
class Ad {
public $dbc;
public $id;
public $title = '';
public $body = '';
@bbatsche
bbatsche / student.php
Last active August 29, 2015 14:06
Student Class Example
<?php
class Student
{
public $firstName;
public $lastName;
public $cohort;
public $classStart;
@bbatsche
bbatsche / remove.php
Last active December 11, 2015 21:06
Example of how to use JavaScript and a form to send a request using POST, rather than anchor tags and GET requests.
<?php foreach: ($parks as $parkInfo): ?>
<!-- ... -->
<td>
<!-- This is the button the user will click to remove an item -->
<button class="btn btn-danger btn-xs btn-delete" data-id="<?= $parkInfo['id']; ?>" data-name="<?= $parkInfo['name']; ?>">
Delete
</button>
</td>
@bbatsche
bbatsche / stopwatch.html
Created September 4, 2014 21:00
A JavaScript stop watch, demonstrating the use of events, intervals, and querying the DOM
<!DOCTYPE html>
<html>
<head>
<title>Stop Watch</title>
</head>
<body>
<h1>Stop Watch</h1>
<button id="startButton">Start</button>
<button id="stopButton">Stop</button>
@bbatsche
bbatsche / todo_init.php
Created August 19, 2014 21:00
Todo List Sorting
<?php
$items = [
0 => 'first',
1 => 'second',
2 => 'third'
];
// A
@bbatsche
bbatsche / files.php
Created May 21, 2014 16:21
PHP File Handling Notes
<?php
/************************************
* NOTE!!!!
* This file is meant as notes / examples.
* The code, as it's current written, will not work
* and will probably output some errors/notices.
* Use this file as examples, not as code that's meant to be run.
************************************
*/