Skip to content

Instantly share code, notes, and snippets.

View reggiegutter's full-sized avatar
🎯
Focusing

Reginaldo Gutter reggiegutter

🎯
Focusing
View GitHub Profile
@reggiegutter
reggiegutter / file.sql
Created May 9, 2018 04:03 — forked from emmanuel/file.sql
Closure Table operations SQL fragments
-- Retrieve descendants
-- ====================
-- retrieve descendants of #4
SELECT c.*
FROM Comments AS c
JOIN TreePaths AS t ON c.comment_id = t.descendant
WHERE t.ancestor = 4;
-- Retrieve ancestors
@reggiegutter
reggiegutter / closure-table-operations.sql
Created May 9, 2018 04:03 — forked from kentoj/closure-table-operations.sql
Closure Table operations SQL fragments
-- Retrieve descendants
-- ====================
-- retrieve descendants of #4
SELECT c.*
FROM Comments AS c
JOIN TreePaths AS t ON c.comment_id = t.descendant
WHERE t.ancestor = 4;
-- Retrieve ancestors
@reggiegutter
reggiegutter / combo_dinamico.html
Created July 26, 2017 07:31 — forked from ografael/combo_dinamico.html
Carregar combo com JQuery - Cidades e Estados
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.getJSON('estados_cidades.json', function (data) {