Skip to content

Instantly share code, notes, and snippets.

@sfelde
sfelde / ghost-blog
Created February 25, 2014 21:26
ghost-blog
http://stackoverflow.com/questions/20077208/nginx-reverse-proxy-a-ghost-blog-with-subfolder-redirect
http://stackoverflow.com/questions/19817755/create-uri-in-nginx-for-a-ghost-blog
http://fuad.me/install-multiple-ghost-blogs-in-one-linux-server/

Prolog

Google Chrome Developers says:

The new WOFF 2.0 Web Font compression format offers a 30% average gain over WOFF 1.0 (up to 50%+ in some cases). WOFF 2.0 will be available from Chrome M36 (beta) and there on.

TTF to WOFF2 converting

I have installed Googles compression library on a DigitalOcean (ref) server. Feel free to start the convert from TTF to WOFF2. No software installation required. Simply use your terminal window. Web developers, make your life easier and webpages faster!

// Blueleaf API Integration with Google Spreadsheet using Google Scripts to build
// custom spreadsheet functions to retrieve (query only) account data from Blueleaf.
//
// This script code is provided AS IS for demonstration purposes; no warranty of its
// robustness nor any guarantee it will work in your Google Apps environment is
// provided -- Jim Koch 2014
//
// When debugging, use the Logger function below to check the data fields available
// from Blueleaf.
//
@sfelde
sfelde / redmine api with http auth
Created November 18, 2014 16:01
redmine api with http auth
$ curl -H "User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36" http://username:password@domain.ltd/issues.json?key=f68d6496f1bd00767f5asdfa3er23reqecc0d1dd7a0676ac9f2964&limit=100&status_id=3&project_id=8

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@sfelde
sfelde / gist:1853908
Created February 17, 2012 14:54 — forked from honzajavorek/gist:1853867
A readable way how to work with Flask-SQLAlchemy
class Transaction(object):
def __init__(self, db):
self.db = db
def __enter__(self):
return self.db.session
def __exit__(self, type, value, traceback):
@sfelde
sfelde / mysql_dump
Created May 9, 2012 08:22
mysqldump with gzip
#!/bin/bash
#MAILTO=mail@domain.ltd
USER='uname'
PWD='password'
DBNAME='dbname'
DATE=`date +%y%m%d.%H%M`
#backup db
mysqldump --default-character-set="UTF8" --extended-insert=FALSE -u$USER -p$PWD $DBNAME | gzip > $DATE.stage.sql.gz
@sfelde
sfelde / typoscript meta
Created May 9, 2012 14:13
typoscript meta tags
page.meta.keywords.data = register:newsKeywords // field : keywords // levelfield:-1,keywords,slide
page.meta.description.data = register:newsSubheader // field : description // levelfield:-1,description,slide
#add in localconf.php
$TYPO3_CONF_VARS['FE']['addRootLineFields'] = ',description,keywords';
@sfelde
sfelde / mac-version
Created May 10, 2012 21:14
mac verion with python
python -c "import platform; print platform.mac_ver()"
@sfelde
sfelde / gist:2658755
Created May 11, 2012 10:14
virtualenv mac 10.5
virtualenv -p /usr/bin/python sfvirtualenv
cd sfvirtualevn
source bin/activate