Skip to content

Instantly share code, notes, and snippets.

View rodrigo-brito's full-sized avatar
🇧🇷
You are what you share

Rodrigo Brito rodrigo-brito

🇧🇷
You are what you share
View GitHub Profile
@joelonsql
joelonsql / JOIN FOREIGN.md
Last active February 8, 2023 23:29
SQL language proposal: JOIN FOREIGN

SQL language proposal: JOIN FOREIGN

The idea is to improve the SQL language, specifically the join syntax, for the special but common case when joining on foreign key columns.

The problem

Example below taken from PostgreSQL documentation [1]

In SQL-89, we didn't have any JOIN syntax yet, so queries were written in this way:

@rafaelsq
rafaelsq / encdec.sh
Last active April 29, 2020 16:36
Encode/Decode file with openssl
#!/bin/bash
echo "limon" > encdec.dec
echo "Encrypt"
openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 10000 -salt -in encdec.dec -out encdec.enc
ls encdec.*
# encdec.enc encdec.dec
@rafaelsq
rafaelsq / proxy.go
Created June 19, 2017 14:10
Golang Simple Proxy
package main
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
@arkadiusjonczek
arkadiusjonczek / functions.php
Created March 24, 2016 19:13
WP REST API: add thumbnail to posts
function my_rest_prepare_post( $data, $post, $request ) {
$_data = $data->data;
$thumbnail_id = get_post_thumbnail_id( $post->ID );
$thumbnail = wp_get_attachment_image_src( $thumbnail_id );
$_data['featured_image_thumbnail_url'] = $thumbnail[0];
$data->data = $_data;
return $data;
}
add_filter( 'rest_prepare_post', 'my_rest_prepare_post', 10, 3 );
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bootstrap 3.0 Grid System</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style>
body{