Skip to content

Instantly share code, notes, and snippets.

Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.

Website Hosting

@EmmanuelOga
EmmanuelOga / layout.html.erb
Created April 26, 2011 20:04
simple packager for rails 3.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Look ma, single css and js packages! (but not on dev mode).</title>
<%= include_packaged_styles "generic.css" %>
<%= include_packaged_scripts "generic.js" %>
<%= yield :head %>
</head>
<body>
@ijt
ijt / http_get.go
Last active August 23, 2021 12:37
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@tlhl28
tlhl28 / gist:1053143
Created June 29, 2011 04:26
Simple mysql query class --- php
<?php
/**
* ======Usage=====
*
* $db = new Database("127.0.0.1","user","pwd","db1");
* $data = $db->selectDb("db2")
* ->selectTable("table1")
* ->show("column1 as no1")
* ->filter("column1 >", 0)
* ->filter("column2 LIKE", "%hello%")
@arbovm
arbovm / server_setup.md
Created July 27, 2011 16:05 — forked from erotte/server_setup.md
Server Setup Ubuntu 10.4/rvm/nginx/passenger Hosteurope VM

Server Setup

Unsere Setup-Routine für eine Rails-App mit Nginx, Passenger, rvm auf einen Host Europe-VPS mit Ubuntu 10.4.

Installation der benötigten Pakete

apt-get update

apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \

@jszmajda
jszmajda / game_of_life.js
Created September 18, 2011 16:41
Game of Life in Backbone.js
var stepTime = 1;
var col = undefined;
var Cell = Backbone.Model.extend({
x: -1,
y: -1,
alive: false,
nextAlive: false,
initialize: function() {
@innotekservices
innotekservices / jquery.spin.js
Created October 16, 2011 02:39
jQuery Plugin for Spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.