create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
ln -s /etc/nginx/sites-available/sitename /etc/nginx/sites-enabled/sitename | |
ln -s /etc/uwsgi-python/apps-available/sitename.xml /etc/uwsgi-python/apps-enabled/sitename.xml | |
# note that the name of UWSGI directory changed in new ubuntu versions. |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
Getting the Source | |
$ cd ~/source | |
$ curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz | |
$ tar -zxvf lame-3.99.5.tar.gz | |
$ rm -r lame-3.99.5.tar.gz | |
$ cd lame-3.99.5 | |
Installing | |
$ ./configure | |
$ make |
# -*- coding: utf-8 -*- | |
from django import forms | |
from crispy_forms.helper import FormHelper | |
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field | |
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions | |
class MessageForm(forms.Form): | |
text_input = forms.CharField() |
self.view.layer.anchorPoint = CGPointMake(0.50, 1.0); | |
CAKeyframeAnimation *bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; | |
bounceAnimation.values = [NSArray arrayWithObjects: | |
[NSNumber numberWithFloat:0.05], | |
[NSNumber numberWithFloat:1.08], | |
[NSNumber numberWithFloat:0.92], | |
[NSNumber numberWithFloat:1.0], | |
nil]; |
#!/bin/bash | |
DIR=/var/www/YOUR_NODE_APP_GOES_HERE | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
NODE_PATH=/usr/local/lib/node_modules | |
NODE=/usr/local/bin/node | |
test -x $NODE || exit 0 | |
function start_app { | |
NODE_ENV=production nohup "$NODE" "$DIR/YOUR_APP_SERVER_FILE.js" 1>>"$DIR/logs/YOUR_APP_NAME.log" 2>&1 & |
var UserSchema = new Schema({ | |
email : String, | |
hashed_password : String, | |
first_name : String, | |
last_name : String, | |
salt : String, | |
auth_method : String, | |
signupDate : { type: Date, default: Date.now } | |
}); |
This is a mini howto on moving a subdirectory to its own repository retaining history
Assume PARENT
is the original parent Git repository (locally) and CHILD
is the new local repository that you wish to create from a subdirectory, retaining all of its history from the PARENT
repository; PARENT_PATH
and CHILD_PATH
are the paths to PARENT
and CHILD
respectively; SUBDIR is the relative path within the repository under extraction:
git clone --no-hardlinks PARENT_PATH CHILD_PATH
pushd CHILD_PATH
// | |
// FMInfoPanelViewController.h | |
// Created by Florian Mielke (@FlorianMielke) on 06.12.11. | |
// | |
#import <UIKit/UIKit.h> | |
#import <Foundation/Foundation.h> | |
#import <QuartzCore/QuartzCore.h> | |
@interface FMInfoPanelViewController : UIViewController <UIScrollViewDelegate> |
Okay so here's the setup: | |
[-] The primary server API is exposed via Flask (Python) and all static files, including all html, css, js is served by nginx. | |
[-] Python is exposing an API at url http://domain.com/api/download/<file_id>, where file_id is a database id for the file that we're interested in downloading. | |
1. User wants to download a file, so we spawn a new window with the url '/api/download/<file_id>' | |
2. Nginx intercepts the request, sees that it starts with /api/, and then forwards the request to Flask, which is being served on port 5000. | |
3. Flask routes the request to its download method, retrieves the pertinent data from the file_id, and constructs additional header settings to make nginx happy and to force the browser to see the file stream as a download request instead of the browser just trying to open the file in a new window. Flask then returns the modified header stream to nginx | |
4. Nginx is finally ready to do some work. While parsing the headers for the incoming request, it encounters "X |