Skip to content

Instantly share code, notes, and snippets.

View macedd's full-sized avatar
🐋
Looking for growth opportunities

Thiago F Macedo macedd

🐋
Looking for growth opportunities
View GitHub Profile
@evadne
evadne / .siFancyScrollbar.less
Created February 20, 2010 04:01
Fancy Scrollbar (in WebKit). Written using LESS, needs gem to compile down to regular .CSS.
.siFancyScrollbar {
::-webkit-scrollbar,
::-webkit-scrollbar-button:start:increment,
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment,
::-webkit-scrollbar-button:end:decrement {
width: 9px;
height: 9px;
@cyberfox
cyberfox / humanize.js
Created October 20, 2011 18:43
JavaScript humanize method.
com = { cyberfox: {} };
/**
* Convert a property name into a human readable string by replacing _ with
* spaces, and upcasing the first letter of each word.
*
* @param {string} property The property name to convert into a readable name.
* @return {string} The property name converted to a friendly readable format.
* @private
*/
@cwestin
cwestin / aggregation.js
Created November 28, 2011 19:12
Mongo shell script and sample documents used for my aggregation talks 12/2011
// make sure we're using the right db; this is the same as "use aggdb;" in shell
db = db.getSiblingDB("aggdb");
// simple projection
var p1 = db.runCommand(
{ aggregate : "article", pipeline : [
{ $project : {
tags : 1,
pageViews : 1
}}
@toekneestuck
toekneestuck / underscore.nl2br
Created February 21, 2012 20:29
A port of nl2br to Underscore
_.mixin({
nl2br : function(str, is_xhtml){
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
}
});
@pelle
pelle / accounts.clj
Created May 8, 2012 14:37
Using database functions in Datomic transactions and annotating transaction history
(use '[datomic.api :only [q db] :as d])
(def uri "datomic:mem://accounts")
;; create database
(d/create-database uri)
;; connect to database
(def conn (d/connect uri))
@bhurlow
bhurlow / gist:3043629
Created July 3, 2012 21:57
Linux Screen Cheat Sheets
–ctrl a c -> cre­ate new win­dow
–ctrl a A -> set win­dow name
–ctrl a w -> show all win­dow
–ctrl a 1|2|3|… -> switch to win­dow n
–ctrl a ” -> choose win­dow
–ctrl a ctrl a -> switch between win­dow
–ctrl a d -> detach win­dow
–ctrl a ? -> help
–ctrl a [ -> start copy, move cur­sor to the copy loca­tion, press ENTER, select the chars, press ENTER to copy the selected char­ac­ters to the buffer
–ctrl a ] -> paste from buffer
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@sansmischevia
sansmischevia / nginx.conf
Last active July 3, 2023 15:26
nginx http proxy to s3 static websites
##
## This nginx.conf servers as the main config file for webflow reverse proxy
##
## RCS:
## https://gist.github.com/sansmischevia/5617402
##
## Hardening tips:
## http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
##