Skip to content

Instantly share code, notes, and snippets.

View taylorlapeyre's full-sized avatar

Taylor Lapeyre taylorlapeyre

View GitHub Profile
@taylorlapeyre
taylorlapeyre / thing.php
Created December 20, 2012 05:00
In _view.php
<h4>Images</h4>
<ul>
<?php foreach($data->images as $image) { ?>
<li><img src="<?php echo CHtml::encode($image->url); ?>" alt="<?php echo CHtml::encode($image->description); ?>" /></li>
<?php } ?>
</ul>
@taylorlapeyre
taylorlapeyre / _fancybox.php
Last active December 10, 2015 00:59
Fancybox partial view
<?php
/* @var $this GalleryController
* @var $data ImageGallery
*/
Yii::import('application.extensions.fancybox');
?>
<div class="fancy-view">
<?php
public function getTmpUrl($posted_image)
{
Yii::import('application.extensions.upload.Upload');
// receive file from post
$Upload = new Upload( $posted_image );
$Upload->jpeg_quality = 100;
$Upload->no_script = false;
$Upload->image_resize = true;
<?php
class ImageForm
{
public function setImage($posted_image)
{
Yii::import('application.extensions.upload.Upload');
$upload = new Upload($posted_image);
$upload->jpeg_quality = 100;
$upload->no_script = false;
@taylorlapeyre
taylorlapeyre / git.md
Created January 17, 2013 04:59
Git Walkthrough:
  1. git branch new-branch
  2. git checkout new-branch
  3. [edit code]
  4. git add --all
  5. git commit 'add awesome stuff to thing'
  6. [repeat 2-3 until whenever]
  7. git push origin master

...

int LED = 13; // the pin for the LED
int BUTTON = 7; // the input pin where the pushbutton is connected
int val = 0; // val will be used to store the state of the input pin
int delay_time = 1000;
void setup() {
pinMode(LED, OUTPUT); // tell Arduino LED is an output
pinMode(BUTTON, INPUT); // and BUTTON is an input
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
sudo rm -rf /var/www
sudo ln -fs /vagrant/project/directory /var/www
sudo mysqladmin -s -uroot -pvagrant create project_db --force
sudo mysql -s -uroot -pvagrant -e 'GRANT ALL PRIVILEGES ON project_db.* \
@taylorlapeyre
taylorlapeyre / box.md
Last active December 16, 2015 09:29
Box Details

Every vagrant box starts out as a bare, minimal linux distribution. In our case, this was Ubuntu 12.04 LTS.

This page is a record of every command that was given to this base VM before it was repackaged as the lamp.box that we use. I've also included the vagrant commands used to generate it.

taylorlapeyre: vagrant init precise32
taylorlapeyre: vagrant ssh
# All passwords: "vagrant"
@taylorlapeyre
taylorlapeyre / vagrant-setup.sh
Last active December 16, 2015 09:58
Script to configure a blank, minimal ubuntu install
#!/bin/bash
bootstrap_system() {
set_permissions
configure_ssh
install_vb_guest_additions
install_rbenv
install_ruby
sudo apt-get clean
@taylorlapeyre
taylorlapeyre / PIXELFALL
Created April 25, 2013 02:27
My TI-Calculator Game "Pixelfall"
:PIXELFALL
0→Xmin:94→Xmax:–62→Ymin:0→Ymax
ClrDraw:AxesOff:FnOff
Text(0,23,"FALLING PIXEL
Text(20,23,"PROGRAMMED BY
Text(27,29,"TAYLOR LAPEYRE
Text(37,1,"Highest Score:192457
Text(44,1,"By Allen Krake"
Text(55,41,"v3.0
Pause