Skip to content

Instantly share code, notes, and snippets.

View flyakite's full-sized avatar
:bowtie:
Working from home

Shih-Wen Su flyakite

:bowtie:
Working from home
View GitHub Profile
// http://jsfiddle.net/suBPQ/
$.ajax({
url: "http://api_test_server.proudlygeek.c9.io/",
success: function(data) {
console.log(data);
}
});
@flyakite
flyakite / neo4j.sh
Created April 20, 2014 14:51
neo4j installation
# install java 1.7
# http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz
# http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm
# http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-macosx-x64.dmg
# export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home
# PATH=${PATH}:/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin
var LINE = require('./line.js');
var line = new LINE();
var email = 'your email';
var password = 'your password';
line.login(email, password, function(error, result) {
if (error) {
return;
}

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@flyakite
flyakite / how_do_you_debug.xml
Created February 7, 2014 06:14
One of the request inputs is not valid. !!?? So which input and what do you mean valid?
WindowsAzureError: Unknown error (Bad Request)
<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>InvalidInput</code>
<message xml:lang="en-US">
One of the request inputs is not valid.
RequestId:f6fbc3c1-3494-4aec-8fce-de255b40c33c
Time:2014-02-07T06:05:40.4464752Z</message>
</error>
@flyakite
flyakite / shortcutmiddleware.py
Last active August 29, 2015 13:56
Some requests require no session, auth, locale, csrf check, message, or many other middlewares. Especially, there are some useless db connection in django_session. Skip unnecessary middlewares can make the request much faster.
#
# in your settings file
#
# middleware settings
MIDDLEWARE_CLASSES = (
'some.essential.Middleware',
# this is the home-made shortcut middleware, put right above the middlewares you want to skip
'apps.middleware.ShortcutMiddleware',