Skip to content

Instantly share code, notes, and snippets.

View freekrai's full-sized avatar

Roger Stringer freekrai

View GitHub Profile
<script src="//platform.twitter.com/widgets.js"></script>
<script>
var tweet = {
url: "", // url to share
via: "", // omit @, twitter username
text: "", // tweet text
hashtags: "" // omit #, comma seperated "twitter,twitterapi"
}
var intent_url = 'https://twitter.com/intent/tweet?' + $.param(tweet);
$('a#tweet-button').attr('href', intent_url);
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /prerender-test/
# Virtual/pushState URIs (requests not matching an existing file get forwarded to index.html)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.html [L]
<IfModule mod_proxy_http.c>
@freekrai
freekrai / .htaccess
Last active August 29, 2015 14:08 — forked from thoop/.htaccess
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
#RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@freekrai
freekrai / README.md
Last active August 29, 2015 14:15 — forked from mrkrstphr/README.md

Deploying Sculpin Sites to GitHub Pages

I wanted to be able to use Sculpin to generate GitHub pages. Here's what I did...

  1. Created a super awesome Sculpin site from the Sculpin Blog Skeleton

  2. Make sure everything is under version control in my master branch (except things that shouldn't be. see the .gitignore)

  3. Updated publish.sh:

#!/bin/bash

@freekrai
freekrai / practice
Last active August 29, 2015 14:16 — forked from dbalatero/practice
#!/usr/bin/env ruby
class Practice
def initialize
@data = {}
try_to_load_data
end
def record_today(minutes)
@data[key_for(Time.now)] = minutes
@freekrai
freekrai / curl.md
Last active August 29, 2015 14:21 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
// # getScript()
// more or less stolen from jquery core and adapted by paul irish
function getScript(url,success) {
var head = document.getElementsByTagName("head")[0], done = false;
var script = document.createElement("script");
script.src = url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function(){
if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) {
@freekrai
freekrai / .travis.yml
Last active September 4, 2015 20:28 — forked from cotsog/.travis.yml
Custom MongoDB version on container infrastructure
sudo: false
env:
global:
- MONGODB_VERSION=2.6.10
install:
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-$MONGODB_VERSION.tgz
- tar xfz mongodb-linux-x86_64-$MONGODB_VERSION.tgz
- export PATH=`pwd`/mongodb-linux-x86_64-$MONGODB_VERSION/bin:$PATH
- mkdir -p data/db
- mongod --dbpath=data/db &