In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
// LZW-compress a string | |
function lzw_encode(s) { | |
var dict = {}; | |
var data = (s + "").split(""); | |
var out = []; | |
var currChar; | |
var phrase = data[0]; | |
var code = 256; | |
for (var i=1; i<data.length; i++) { | |
currChar=data[i]; |
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
# Initialize the scroll | |
page = es.search( | |
index = 'yourIndex', | |
doc_type = 'yourType', | |
scroll = '2m', | |
search_type = 'scan', | |
size = 1000, | |
body = { | |
# Your query's body | |
}) |
""" | |
To Test this Script the start 8 memcache servers using this command. | |
$ memcached -d -p {PortNumber} | |
PortNumber: | |
11211 | |
11212 | |
11213 | |
11214 |
PEP-8 is a set of Python style recommendations. pep8
is a module that checks your .py
file for violations. To make your Travis-CI build fail if you have any violations, you could add these lines to your .travis.yml
:
before_install:
- pip install pep8
script:
# Run pep8 on all .py files in all subfolders
# (I ignore "E402: module level import not at top of file"
# because of use case sys.path.append('..'); import <module>)
2016/01/08 23:57:02 [error] 68363#0: *38 SSL_do_handshake() failed (SSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure) while SSL handshaking to upstream, client: 127.0.0.1, server: localhost, request: "GET /api/providers HTTP/1.1", upstream: "https://xx.xx.xx.xx:443/stage", host: "localhost" | |
2016/01/08 23:57:02 [warn] 68363#0: *38 upstream server temporarily disabled while SSL handshaking to upstream, client: 127.0.0.1, server: localhost, request: "GET /api/providers HTTP/1.1", upstream: "https://xx.xx.xx.xx:443/stage", host: "localhost" |
This blog post has helped me clean up my postgres development environment on Mac. So making a copy!
How completely uninstall PostgreSQL 9.X on Mac OSX
This article is referenced from stackoverflow:
If installed PostgreSQL with homebrew , enter brew uninstall postgresql
If you used the EnterpriseDB installer , follow the following step.
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
'use strict'; | |
var webpack = require('webpack'), | |
path = require('path'), | |
BowerWebpackPlugin = require('bower-webpack-plugin'); | |
module.exports = { | |
entry: { | |
vendor: [ | |
'angular', |