Skip to content

Instantly share code, notes, and snippets.

@trooney
trooney / party.js
Last active August 29, 2015 14:05
Turn any website with jQuery into a party!
/* Paste into console */
window.party=function(){if(window.$==undefined)return"You need jQuery to party!";var $mask,$video;$mask=$('<div style="position: absolute; top: 0; left: 0; bottom: 0; right: 0; background-color: #000; background-image: url(http://i.imgur.com/1bxqLXC.jpg); opacity: 0.9; background-size: cover; z-index: 1000;" />');$video=$('<iframe width="420" height="315" src="//www.youtube.com/embed/bDbpzjbXUZI?autoplay=1" frameborder="0" allowfullscreen style="position:absolute; top: 50%; left: 50%; margin-left: -210px; margin-top:-150px; z-index:1005;"></iframe>');
$mask.appendTo("body");$video.appendTo("body");return"lets do it!!"};"ready to party? call window.party()";
def yield_placeholder(name, content = nil, &block)
if content_for?(name)
concat @view_flow.get(name)
else
if block_given?
content = capture(&block)
end
concat content
end
end
@trooney
trooney / dev.yml
Last active December 28, 2015 07:49
Ansible | Dev Environment
---
- hosts: all
sudo: True
pre_tasks:
- name: APT | Check cache update time
stat: path=/var/cache/apt
register: apt_cache_stat
- name: APT | Update stale cache
apt: update_cache=yes
@trooney
trooney / CompaniesController.php
Created May 15, 2011 00:53
li3: simple search feature
<?php
namespace app\controllers;
use lithium\data\Entity;
use app\models\Companies;
class CompaniesController extends \lithium\action\Controller {
public function search() {