Skip to content

Instantly share code, notes, and snippets.

View cdesch's full-sized avatar
🏠
Working from home

cdesch cdesch

🏠
Working from home
View GitHub Profile
cjs-MacBook-Pro-4:myapp cj$ bundle exec rake --tasks --trace
rake aborted!
undefined method `each' for nil:NilClass
/Users/cj/RubymineProjects/myapp/config/application.rb:24:in `<class:Application>'
/Users/cj/RubymineProjects/myapp/config/application.rb:10:in `<module:myapp>'
/Users/cj/RubymineProjects/myapp/config/application.rb:9:in `<top (required)>'
/Users/cj/RubymineProjects/myapp/Rakefile:4:in `require'
/Users/cj/RubymineProjects/myapp/Rakefile:4:in `<top (required)>'
/Users/cj/.rvm/gems/ruby-2.0.0-p247@myapp/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/Users/cj/.rvm/gems/ruby-2.0.0-p247@myapp/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
<% entry = @featured_entries.first %>
<article class="entry style-grid style-hero hero-sm-largest type-post col-sm-12 col-md-6 colheight-sm-1 colheight-md-2 colheight-lg-2 colheight-xl-2">
<div class="ribbon ribbon-pulled ribbon-small ribbon-highlight">
<%= link_to entry.category.try(:name), entry.category %>
</div>
<header class="entry-header">
<h3 class="entry-title"><%= link_to entry.title, entry %></h3>
#ActiveAdmin User
ActiveAdmin.register User do
index do
column :email
column :alias
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end
@cdesch
cdesch / OS X Wiki Server Whitelist
Last active December 15, 2015 22:59
OS X Wiki Server Whitelist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>protocols</key>
<array>
<string>scp</string>
</array>
<key>styles</key>
<array>
@cdesch
cdesch / accounts-models.py
Created November 30, 2012 14:58 — forked from erikankrom/accounts-models.py
Multiple Profiles for Internal/External Users
from django.db import models
from django.contrib.auth import User
from mycompany.models import Client
from userprofiles.models import Profile
class External(Profile):
#External-specific models
client = models.ForeignKey(Client)
def __unicode__(self):
$().ready(function(){
// Instant Search
$('#q').keyup(function(){
$('.search_item').each(function(){
var re = new RegExp($('#q').val(), 'i')
if($(this).children('.search_text')[0].innerHTML.match(re)){
$(this).show();
}else{
$(this).hide();
};
@cdesch
cdesch / ds12B20.c
Created July 6, 2012 03:24
DS12B20
#include <avr/io.h>
#include <avr/interrupt.h>
#define F_CPU 8000000UL
#include <util/delay.h>
#include <stdlib.h>
#include "ds18b20.h"
@cdesch
cdesch / uart.c
Created May 1, 2012 03:09
UART Library
/*************************************************************************
Title: Interrupt UART library with receive/transmit circular buffers
Author: Peter Fleury <[email protected]> http://jump.to/fleury
File: $Id: uart.c,v 1.6.2.2 2009/11/29 08:56:12 Peter Exp $
Software: AVR-GCC 4.1, AVR Libc 1.4.6 or higher
Hardware: any AVR with built-in UART,
License: GNU General Public License
DESCRIPTION:
An interrupt is generated when the UART has finished transmitting or
@cdesch
cdesch / gist:2380263
Created April 13, 2012 21:21
avr-gcc error
cjs-MacBook-Pro:github cj$ cat cjs-MacBook-Pro:github cj$ brew install homebrew-alt/avr/avr-libc.rb
cat: cjs-MacBook-Pro:github: No such file or directory
cat: cj$: No such file or directory
cat: brew: No such file or directory
cat: install: No such file or directory
require 'formula'
def relative(name)
return name if name.kind_of? Formula
File.join(File.split(__FILE__)[0], name) + '.rb'
@cdesch
cdesch / gist:2033820
Created March 14, 2012 03:31
Simple NSDate Components - Easy to break into pieces
NSDate *currDate = [NSDate date]; //Current Date
NSDateFormatter *df = [[NSDateFormatter alloc] init];
//Day
[df setDateFormat:@"dd"];
NSString* myDayString = [NSString stringWithFormat:@"%@", [df stringFromDate:currDate]];
//Month
[df setDateFormat:@"MM"]; //MM will give you numeric "03", MMM will give you "Mar"
NSString* myMonthString = [NSString stringWithFormat:@"%@", [df stringFromDate:currDate]];