A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
| # vi: ft=dosini | |
| [user] | |
| name = Pavan Kumar Sunkara | |
| email = [email protected] | |
| username = pksunkara | |
| [core] | |
| editor = nvim | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| pager = delta | |
| [column] |
| def fizz_buzz_1(max) | |
| arr = [] | |
| (1..max).each do |n| | |
| if ((n % 3 == 0) && (n % 5 == 0)) | |
| arr << "FizzBuzz" | |
| elsif (n % 3 == 0) | |
| arr << "Fizz" | |
| elsif (n % 5 == 0) | |
| arr << "Buzz" | |
| else |
| var express = require('express'), | |
| httpProxy = require('http-proxy'), | |
| app = express(); | |
| var proxy = new httpProxy.RoutingProxy(); | |
| function apiProxy(host, port) { | |
| return function(req, res, next) { | |
| if(req.url.match(new RegExp('^\/api\/'))) { | |
| proxy.proxyRequest(req, res, {host: host, port: port}); |
| // JavaScript hasClass, addClass, removeClass | |
| //source: http://www.avoid.org/?p=78 | |
| function hasClass(el, name) { | |
| return new RegExp('(\\s|^)'+name+'(\\s|$)').test(el.className); | |
| } | |
| function addClass(el, name) | |
| { | |
| if (!hasClass(el, name)) { el.className += (el.className ? ' ' : '') +name; } |
| /* bad indentation is NetBeans' fault, camelCase is Propel's fault */ | |
| var retrieveTeachers = function(query, process) { | |
| // let them be json | |
| var transformTeachers = function(teachers) { | |
| return $.map(teachers, function(teacher) { | |
| return { | |
| id: teacher.Id, | |
| FullName: (teacher.Name + ' ' + teacher.Surname), | |
| // these functions allows Bootstrap typehead to use this item in places where it was expecting a string | |
| toString: function() { |
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf
File locations:
nginx.conf to /usr/local/etc/nginx/default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-availablehomebrew.mxcl.nginx.plist to /Library/LaunchDaemons/| var http = require('http'); | |
| var express = require('express'); | |
| var router = express.Router(); | |
| /* GET users listing. */ | |
| router.get('/', function(req, res) { | |
| var request = require('request'); | |
| var url = req.query.url; |
brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgentsReplace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.