This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resource Cache mechanism, for projects and people | |
Resource Cache is a key-value auto-expiring cache, where we pass | |
the path for a base model + a resource owned by it + modifiers. | |
Structure | |
--------- | |
Each cacheable entry is called with two or three parameters: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this in your JS console while on box.com | |
$("#files_tab").after( | |
'<li id="teambox_tab" class="current">' + | |
'<a id="teambox_tab_link" href="https://teambox.com?embedded=1" onmousedown="return false;">Teambox</a></li>' | |
); | |
$(".body .main").html( | |
'<iframe src="https://teambox.com?embedded=1" style="border: none; width: 720px; height: 100000px"></iframe>' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var setupRegularResize, setupIframeResize, e; | |
function bind(a, b) { | |
return function () { | |
return a.apply(b, arguments); | |
}; | |
} | |
setupRegularResize = (function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a debugger with the given `name`. | |
* | |
* @param {String} name | |
* @return {Type} | |
* @api public | |
*/ | |
function debug(name) { | |
var now = Date.now(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Show a notice when Mac's stupid scroll happens | |
* http://micho.biz/mac-osx-lion-horizontal-scroll-event/ | |
*/ | |
Global.preventStupidMacScroll = function () { | |
var self = this, | |
broken_browser = navigator.userAgent.match(/Macintosh/), | |
hide = Teambox.models.user.get('settings').hide_scroll_notice; | |
if (!broken_browser || hide) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, install nginx for mac with "brew install nginx". | |
Then follow homebrew's instructions to know where the config file is. | |
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self | |
2. Copy it somewhere (use full path in the example below for server.* files) | |
3. sudo nginx -s reload | |
4. Access https://localhost/ | |
Edit /usr/local/etc/nginx/nginx.conf: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
function precmd() { | |
PROMPT="%n@%m %~$(parse_git_branch)%# " | |
} | |
export PATH="/usr/local/mysql/bin:${PATH}:/usr/local/git/bin" | |
function proml { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin.onMessageSend = function (event) { | |
var match, url, content; | |
if (match = event.content.match(/(https?:\/\/cl.ly\/[^\/]+)(\/[^\/]+)*/)) { | |
url = match[1] || false; | |
content = match[2] || false; | |
if (!content || content.indexOf('/content') != -1) { | |
event.content = event.content.replace(url, url+'/content#.png'); | |
Talker.sendMessage(event, ""); | |
Talker.getMessageBox().val(''); | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin.onMessageSend = function (event) { | |
if ((new Date()).getDate() === 14) { | |
if ((event.content.match(/^([a-z]+)$/) || [false])[0]) { | |
alert('Y U NO UZ CAPSLOCK?'); | |
} | |
Talker.sendMessage(event.content.toUpperCase()); | |
Talker.getMessageBox().val(''); | |
return false; | |
} | |
else { |