Skip to content

Instantly share code, notes, and snippets.

View danielmelogpi's full-sized avatar
🔬

Daniel Melo danielmelogpi

🔬
View GitHub Profile
exports.flight = function(req, res){
var number = req.param("number");
if (typeof flights[number] == "undefined") {
res.status(400).json({status: "error", msg: "this is undefined flight"});
}
else {
res.json(flights[number].getInformation());
}
a=$(curl -s ipogre.com/linux.php); a=${a##* }; echo ${a%%<*}
@danielmelogpi
danielmelogpi / post-receive
Created March 16, 2014 02:41
This goes on the server bare git repository, in the hooks/ folder. It makes a checkout of the most recente working tree instance to the project published folder.
#!/bin/sh
GIT_WORK_TREE=/var/www/nginx/danielmelo git checkout -f
# http://toroid.org/ams/git-website-howto
@danielmelogpi
danielmelogpi / gist:9579212
Created March 16, 2014 06:02
server part for NGINX configuration
server {
listen 80;
server_name domain.tk;
access_log logs/danielmelo.access.log ;# main;
location / {
try_files $uri $uri/ index.php index.html =404;
root /var/www/nginx/danielmelo;
index index.php index.html index.htm;
<!-- IMPRIME, mas so se marcar o ultimo ele vai pra propriedade do bean -->
<ui:repeat value="#{local.obsService.obsDefault}" var="obsDefault">
<h:selectManyCheckbox value="#{local.obsForm}" id="obstaculos">
<f:selectItem itemLabel="#{obsDefault.nome}" itemValue="#{obsDefault.nome}" />
</h:selectManyCheckbox>
</ui:repeat>
<!-- NÃO IMPRIME-->
<h:selectManyCheckbox id="obstaculos" value="local.obsForm">
<f:selectItem value="#{local.obsService.obsDefault}" itemValue="#{local.obsService.obsDefault}" />
</h:selectManyCheckbox>
@danielmelogpi
danielmelogpi / query-1.sql
Last active August 29, 2015 14:03
Querys - BD
/*
Referência: -16.78024 -49.15648
*/
WITH referencia as (
SELECT ST_Geomfromtext('POINT(-16.78024 -49.15648)', 4326)::geography as point
)
SELECT l.nome, l.lat, l.lon, ST_Distance(
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
@danielmelogpi
danielmelogpi / nodejs-log-exposer.js
Created May 2, 2016 03:49
a simple nodejs http socket to help me expose logs to ousiders when needed
var http = require("http"),
fs = require("fs");
var server = http.createServer(function(request, response) {
var content = fs.readFileSync("./meu-conteudo.txt");
response.end(content);
});
server.listen(3000);
#!/bin/bash
montar() {
mount -t vboxsf "$1" "$2"
}
desmontar() {
umount -t vboxsf "$1"
}