Skip to content

Instantly share code, notes, and snippets.

View d2s's full-sized avatar

Daniel Schildt d2s

View GitHub Profile
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.
@nathansmith
nathansmith / html_reset.css
Created January 28, 2010 00:02
Reset for HTML4 / HTML5
/* `XHTML, HTML4, HTML5 Reset
----------------------------------------------------------------------------------------------------*/
a,
abbr,
acronym,
address,
applet,
article,
aside,
@defunkt
defunkt / browser
Created March 1, 2010 10:01
pipe html to a browser
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo '<h1>hi mom!</h1>' | browser
# $ ron -5 man/rip.5.ron | browser
if [ -t 0 ]; then
if [ -n "$1" ]; then
@defunkt
defunkt / installing-mustache.vim.md
Created March 6, 2010 10:21
Installing mustache.vim

mustache.vim

In your shell:

cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/

rm -rf mustache.vim

@0xnbk
0xnbk / .php
Created September 13, 2010 08:33
Get Your Most Recent Twitter Status (PHP)
<?php
function get_status($twitter_id, $hyperlinks = true) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1");
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$src = curl_exec($c);
curl_close($c);
preg_match('/<text>(.*)<\/text>/', $src, $m);
$status = htmlentities($m[1]);
if( $hyperlinks ) $status = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $status);
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@lantrix
lantrix / IMStatus.scpt
Created January 3, 2011 12:55
Applescript to tell Adium, Skype and iChat to change their status simultaneously
-- IMStatus
-- version 2.0, Lantrix (http://techdebug.com)
-- idea conceived from script by Jason Kenison "theWebGuy" Blog at:
-- http://www.jasonkenison.com/blog.html?id=22
(*
Copyright (c) 2008, TechDebug.com
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@d2s
d2s / content.html
Created January 5, 2011 20:29
Clickable div overlay
<div class="project img_project1">
<div class="link-div">
<object type="img/gif">
<a class="lightbox" href="http://example.com/">
<img src="/images/spacer.gif" alt="" width="100%" height="100%" />
</a>
</object>
</div>
<h5>Project 1</h5>
<p>Description of the project.</p>