Skip to content

Instantly share code, notes, and snippets.

View renanpalmeira's full-sized avatar

Renan renanpalmeira

View GitHub Profile
@rponte
rponte / using-uuid-as-pk.md
Last active June 18, 2024 00:27
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@diego3g
diego3g / settings.json
Last active June 21, 2024 13:11
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@fwbrasil
fwbrasil / AsyncMacro.java
Last active August 28, 2017 01:41
Java macro DSL
/**
*
* THIS IS JUST A DSL PROTOTYPE
*
* First tentative of a DSL for defining macro transformations in Java.
* There's a lot of noise because of the absence of pattern matching and tuples.
* This is a prototype of one of the if/else transformations in Monadless:
*
* case q"if($cond) $ifTrue else $ifFalse" =>
* (ifTrue, ifFalse) match {
@anderson-marin26
anderson-marin26 / Escola.cpp
Created June 2, 2016 15:52
Prova P2 Bortot
// Programa Escola de Natação - Prova N2 - 01/06/2016 - Turma da Tarde
//
#include "Escola.h"
// Entry point do programa
//
void main(void)
{
int nPeriodo, // periodo da aula de natação
nRaia, // raia da piscina
nPosicionalRaia, // posicional da raia dentro do arquivo de raias
@rnjailamba
rnjailamba / solr.txt
Last active June 14, 2023 16:51
Remove managed-schema and get schema.xml in SOLR core [ Version 5.5.0 ]
Lets say solr is located at /usr/local/solr-5.5.0 .
1. bin/solr start
2. bin/solr create -c test
3. location of new core is here /usr/local/solr-5.5.0/server/solr/test
4. location of solrconfig is here /usr/local/solr-5.5.0/server/solr/test/solrconfig.xml
5. Open solrconfig.xml -
You will find this
<schemaFactory class="ManagedIndexSchemaFactory">
<bool name="mutable">true</bool>
<str name="managedSchemaResourceName">managed-schema</str>

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@brigand
brigand / app.js
Last active June 29, 2017 15:52
React JS Event-Emitter Mixin and Example
var React = require("react"), Dom = React.DOM;
var LogOutButton = require('./src/logout');
var events = require('api/events');
var Main = React.createClass({
// this mixin provides this.emitLogout, and if we set onLogout it'll be called when "logout" is emitted
mixins: [events.mixinFor("logout")],
getInitialState: function(){
return {
@bonndan
bonndan / .Xmodmap
Created March 18, 2014 21:21
xmodmap config for apple keyboard under ubuntu
! clean most of the modifiers
clear control
clear mod4
clear mod1
! gt, lt
keycode 49 = less greater less greater bar brokenbar bar
keycode 94 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032
! -----------------
@rob-murray
rob-murray / add_intellij_launcer
Last active June 10, 2024 20:32
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@alanhamlett
alanhamlett / api.py
Last active January 24, 2023 21:03
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort