Skip to content

Instantly share code, notes, and snippets.

{
"name": "xx",
"version": "0.0.1",
"description": "xxx",
"main": "index.js",
"scripts": {
"start": "node server.js",
"mock": "node api/index.js"
},
"repository": {
'use strict';
let webpack = require('webpack');
let webpackDevMiddleware = require('webpack-dev-middleware');
let colors = require('colors');
let path = require('path');
let proxy = require('proxy-middleware');
let url = require('url');
let config;
'use strict';
let webpack = require('webpack');
let path = require('path');
const dirname = __dirname.replace('/webpack', '');
console.log(path.resolve(dirname, './node_modules/'));
let config = {
entry: [
'webpack-hot-middleware/client',
@leandrooriente
leandrooriente / gist:11e17aa650f90863cc80
Last active August 29, 2015 14:13
Kpalíndromo em javascript usando recursividade
function kpalindrome (word, k){
var len = word.length,
lastCharIndex = len - 1;
if (len === 0 || len === 1) {
return true;
}
if (word[0] === word[lastCharIndex]) {
// Remove first and last characteres of the string
@leandrooriente
leandrooriente / gist:3403359aadad88824d57
Last active January 16, 2020 00:39
Palíndromo recursivo mais elegante do universo em javascript
function palindrome (word){
var len = word.length,
lastCharIndex = len - 1;
if (len === 0 || len === 1) {
return true;
}
if (word[0] === word[lastCharIndex]) {
word = word.substr(0, lastCharIndex).substr(1);
@leandrooriente
leandrooriente / .bashrc
Created December 17, 2013 14:35
Ajusta terminal para mostrar: username:directory (branchname)
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]:\[\e[0m\]\[\e[00;36m\]\W\[\e[0m\]\[\e[00;34m\]\$(parse_git_branch)\[\e[0m\] "

Setup Mac OS X Mountain Lion

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first time I needed to reinstall everything, maybe the next time...