Skip to content

Instantly share code, notes, and snippets.

@imhoffd
imhoffd / .htaccess
Created September 1, 2013 00:15 — forked from clawfire/.htaccess
strictly apache 2.4 htaccess for PancakeApp
Options +FollowSymlinks
RewriteEngine on
# On Rackspace and getting 404's? Uncoment this by removing the # :
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_rewrite.c>
@imhoffd
imhoffd / shoutlet.sublime-project
Last active January 2, 2016 15:29
sublime shoutlet project file
{
"build_systems":
[
{
"name": "Shoutlet App Devbox Build",
"shell_cmd": "shovel shoutlet.config daniel && rsync -avzH --exclude '.git' --exclude 'cache' --exclude 'log' --exclude '*.pyc' --exclude '__pycache__' -e ssh --progress --delete ./* daniel@dev2.shoutlet.com:~/sandbox/app/; ssh daniel@dev2.shoutlet.com 'chmod -R 777 ~/sandbox/app/smarty/compile'",
"working_dir": "${project_path}/shoutlet/app"
}
],
"folders":
@imhoffd
imhoffd / MyClass.php
Last active January 4, 2016 06:59
Proper attribute documentation for PHPDoc & PHP Getters & Setters
<?php
namespace Awesome;
class MyClass
{
/**
* object for something something something
*
* @var \Awesome\OtherClass
package com.danielimhoff.grep;
import java.io.File;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.lang.IllegalArgumentException;
<?php
namespace MyNamespace\YouTube;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
/**
* @ODM\Document(db="analytics", collection="youtube")
* @ODM\InheritanceType("SINGLE_COLLECTION")
* @ODM\DiscriminatorField("type")
@imhoffd
imhoffd / vim.rb
Last active August 29, 2015 13:59 — forked from mgrouchy/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
from helper_something import assert_later
class TestCase():
def test_blah(self):
self.assertCollectionPayload(rs.response,
payload={'type': 'legacy_profile',
'client_id': assert_later(self.assertRegex, '[0-9]*'),
'sub_doc': assert_later(self.assertPayload,
payload={'type': 'something',
val file = sc.textFile("/temp/pagecounts-20100212-050000")
val filteredFile = file.filter(line => line.contains("Main_Page"))
val keyedFile = filteredFile.keyBy(line => new BigInt(new java.math.BigInteger(line.split(" ")(3))))
keyedFile.sortByKey(false).collect()
import os
import sys
sys.path.append('/home/dwieeb/kisasa-5000/application')
sys.path.append('/home/dwieeb/.python/lib/python3.4/site-packages')
os.environ['PYTHON_EGG_CACHE'] = '/home/dwieeb/.python-egg'
def application(environ, start_response):
@imhoffd
imhoffd / Pagination.php
Created November 11, 2014 18:22
Pagination class
<?php
class Pagination {
private $config;
private $base_url;
private $limit;
private $num_items;
private $page;
private $is_paginated = false;
private $first_button;
private $previous_button;