Skip to content

Instantly share code, notes, and snippets.

View freekrai's full-sized avatar

Roger Stringer freekrai

View GitHub Profile

Intro

These gists will help through the installation of PHP54, MySQL, and Postgres

Pre-Requisists

This assumes that you have already installed Homebrew (http://mxcl.github.io/homebrew/)

Installation

<?php
$email = "me@example.com";
// To find your weather feed....
// * Go here: http://forecast.weather.gov/MapClick.php?lat=37.7749295&lon=-122.41941550000001#.UdpHAj7714E
// * Search for your location (upper left side of the page as of 7/7/2013)
// * Click the orange "XML" button/link (on the right hand side, beneath the first map as of the same date)
$feed = 'http://forecast.weather.gov/MapClick.php?lat=39.01000&lon=-96.28&unit=0&lg=english&FcstType=dwml';
<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();
},
@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

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 / 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