Skip to content

Instantly share code, notes, and snippets.

View lefnire's full-sized avatar

Tyler Renelle lefnire

View GitHub Profile
@lefnire
lefnire / gist:1854789
Created February 17, 2012 18:45
InsertNode 7 Snippet (requires token_filter)
<?php
/**
* Implements hook_tokens().
* This is used to insert nodes or node-tokens into content with token_filter,
* @see http://drupal.org/node/902244#comment-5616694
*/
function sharpe_tokens($type, $tokens, array $data = array(), array $options = array()) {
$replacements = array();
@lefnire
lefnire / gist:2870431
Created June 4, 2012 19:46
Drupal disable errors for anonymous
<?php
// Disable all errors
function MODULE_page_alter(&$page) {
global $user;
if (!$user->uid) {
unset($_SESSION['messages']['error']);
}
}
// Disable specific errors
@lefnire
lefnire / gist:3190506
Created July 27, 2012 21:17
Why Meteor doesn't use NPM
Takimoto
ins0mnia: http://www.quora.com/Meteor-web-framework/Why-doesnt-Meteor-use-npm
4:53
ins0mnia
Takimoto: Do you know if this would be possible once server-side rendering is introduced?
4:53
Takimoto
i guess so
it's more a philosophical question - technically it should work fine
4:53
@lefnire
lefnire / gist:3450734
Created August 24, 2012 13:49
Code/Error Dumps
lefnire$ jitsu deploy
info: Welcome to Nodejitsu lefnire
info: jitsu v0.9.7
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in server.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write /Users/lefnire/Dropbox/tyler/Sites/personal/habitrpg/derby/package.json
warn: Using '*' as a version for dependencies may eventually cause issues
@lefnire
lefnire / gist:3750232
Created September 19, 2012 15:22
Demonstrate Enyo Panels animation artifacts
enyo.kind({
name: "App",
kind: "FittableColumns",
classes: "app onyx",
components: [
{components:[
{content:'Show Content', ontap:'contentPanelShow'},
{content:'Show Contact', ontap:'contactPanelShow'},
]},
2012-10-24T21:16:28+00:00 app[web.1]: if(self.isMasterDoc['arbiterOnly'] == true) {
2012-10-24T21:16:28+00:00 app[web.1]: ^
2012-10-24T21:16:28+00:00 app[web.1]: /app/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:570
2012-10-24T21:16:28+00:00 app[web.1]: at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2012-10-24T21:16:28+00:00 app[web.1]:
2012-10-24T21:16:28+00:00 app[web.1]: TypeError: Cannot read property 'arbiterOnly' of undefined
2012-10-24T21:16:28+00:00 app[web.1]: at canCheckoutReader (/app/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:570:22)
2012-10-24T21:16:28+00:00 app[web.1]: at Server.checkoutReader (/app/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:590:16)
2012-10-24T21:16:28+00:00 app[web.1]: at __executeQueryCommand (/app/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:1342:79)
2012-10-24T21:16:28+00:00 app[
@lefnire
lefnire / gist:4026626
Created November 6, 2012 18:40
Derby Community Info (Workflowy Export)
Derby Community Info
- Projects
- Codeparty (Brian & Nate)
"https://github.com/codeparty"
- Derby
"https://github.com/codeparty/derby"
- Derby Examples
"https://github.com/codeparty/derby-examples"
- Racer
@lefnire
lefnire / gist:4047269
Created November 9, 2012 18:14
tmars dribbble output
/**
profile:
{ followers_count: 36,
website_url: 'http://www.marshall.io',
comments_count: 24,
name: 'Tim Marshall',
comments_received_count: 16,
likes_count: 703,
id: 44656,
username: 'tmars',
@lefnire
lefnire / gist:4073148
Created November 14, 2012 16:31
install private npm module on heroku
// see https://npmjs.org/doc/json.html and http://stackoverflow.com/questions/10869796/npm-private-git-module-on-heroku#comment18161791_10869796
"dependencies" : {
"my-module" : "git+https://my_username:[email protected]/my_bitbucket_account/my_repo.git"
}
@lefnire
lefnire / gist:4100661
Created November 17, 2012 22:09
mikeal/request with LinkedIn
var request = require('request')
, qs = require('querystring')
// LinkedIn Specifics
, apiHost = 'https://api.linkedin.com/v1'
, oauth = {
consumer_key: process.env.LINKEDIN_API_KEY
, consumer_secret: process.env.LINKEDIN_SECRET_KEY
, token: process.env.LINKEDIN_DEFAULT_TOKEN