This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var multiparty = require('multiparty'); | |
var http = require('http'); | |
var util = require('util'); | |
http | |
.createServer(function(req, res) { | |
if (req.url === '/upload' && req.method === 'POST') { | |
// parse a file upload | |
var form = new multiparty.Form(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default termtype. If the rcfile sets $TERM, that overrides this value. | |
set -g default-terminal screen-256color | |
# support logging out and back in | |
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION" | |
# pbcopy support | |
set-option -g default-command "reattach-to-user-namespace -l bash" | |
# vi mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
To setup, place in scripts/generate.js and add | |
"st:generate": "node scripts/generate.js" | |
To your npm scripts. | |
To generate a component in src/components/ run | |
npm run st:generate component my-component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.netflix.experiments.rx; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import rx.Observable; | |
import rx.Observable.OnSubscribe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.abner.vertx.errors; | |
import java.util.UUID; | |
import org.junit.Test; | |
import com.fasterxml.jackson.annotation.ObjectIdGenerators.UUIDGenerator; | |
import io.vertx.core.json.JsonObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from tabela | |
/* UPDATE */ | |
SELECT CONTEUDO->'ficha' from tabela WHERE ID=? FOR UPDATE /* BLOQUEIA A LINHA PARA ATUALIZACAO */; | |
/* OBTEM O INDICE * DO ITEM DA FICHA */ | |
/* FAZ O JSON_B_SET */ | |
UPDATE tabela SET CONTEUDO = JSONB_SET(CONTEUDO, '{ficha,?}'::text, ?::jsonb), ULTIMA_ATUALIZACAO_CONTEUDO=NOW() WHERE ID=? and (conteudo->'ULTIMA_ATUALIZACAO_CONTEUDO' IS NULL OR conteudo->'ULTIMA_ATUALIZACAO_CONTEUDO'=?); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="../node_modules/angular2/core.d.ts" /> | |
/// <reference path="../node_modules/angular2/platform/browser.d.ts" /> | |
/// <reference path="../node_modules/angular2/common.d.ts" /> | |
import { Component, View, Directive, Input, ElementRef, Output, EventEmitter } from 'angular2/core'; | |
import { bootstrap } from 'angular2/platform/browser'; | |
//remove the host of avatar to be rendered as svg | |
@Directive({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css"> | |
<textarea #simplemde></textarea> |