Skip to content

Instantly share code, notes, and snippets.

View joubertredrat's full-sized avatar

Joubert RedRat joubertredrat

View GitHub Profile
@joubertredrat
joubertredrat / main.go
Last active October 13, 2016 19:44
Array of struct
package main
import "fmt"
type Cidade struct {
id int
nome string
}
func main() {
<?php
/* ... */
public static function iniciarModulo()
{
session_start();
if(!isset($_SESSION["system_access"]))
{
session_write_close();
header('Location: login.php#login');
exit();
@joubertredrat
joubertredrat / query.sql
Created October 5, 2016 18:34
Super query
SELECT dia,
(SELECT count(*) FROM `plugveiculos_reservas` WHERE dia = DATE_FORMAT(data_criacao, "%Y-%m-%d")) AS total
FROM (
SELECT
MAKEDATE(YEAR(NOW()),1) +
INTERVAL (MONTH(NOW())-1) MONTH +
INTERVAL daynum DAY dia
FROM
(
SELECT t*10+u daynum
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
[*.{html,css,js}]
indent_style = space
indent_size = 2
[*.php]
@joubertredrat
joubertredrat / gogs.log
Created September 21, 2016 13:25
Error on create repository
2016/09/21 10:02:31 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: updateUser: e-mail has been used [email: my@email]
2016/09/21 10:02:54 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: updateUser: e-mail has been used [email: my@email]
2016/09/21 10:03:19 [...routers/repo/repo.go:101 handleCreateError()] [E] CreatePost: updateUser: e-mail has been used [email: my@email]
@joubertredrat
joubertredrat / font-stacks.css
Created August 26, 2016 13:10 — forked from ct27stf/font-stacks.css
Similar looking fonts for Windows, Linux, Mac
.mono-font-stack {
font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
}
.times-font-stack {
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
}
.modern-font-stack {
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@joubertredrat
joubertredrat / client.log
Created August 26, 2016 11:42
Synergy "ipc connection error, connection refused"
[2016-08-26T08:31:48] DEBUG1: recv mouse down id=1
[2016-08-26T08:31:48] DEBUG1: recv mouse up id=1
[2016-08-26T08:31:51] DEBUG1: recv mouse down id=1
[2016-08-26T08:31:51] DEBUG1: recv mouse up id=1
[2016-08-26T08:31:56] DEBUG1: recv mouse down id=1
[2016-08-26T08:31:57] DEBUG1: recv mouse up id=1
[2016-08-26T08:31:58] DEBUG1: recv mouse down id=1
[2016-08-26T08:31:58] DEBUG1: recv mouse up id=1
[2016-08-26T08:32:00] DEBUG1: recv mouse down id=1
[2016-08-26T08:32:00] DEBUG1: recv mouse up id=1
@joubertredrat
joubertredrat / options-ssl-apache.conf
Created August 11, 2016 14:42
Let's Encrypt SSL configuration to get A on SSL Labs test
# Baseline setting to Include for SSL sites
SSLEngine on
# Intermediate configuration, tweak to your needs
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder on
SSLCompression off
@joubertredrat
joubertredrat / file.conf
Last active August 11, 2016 13:24
Reverse proxy example with Pound
# http://www.apsis.ch/pound/
# https://calomel.org/pound.html
ListenHTTP
Address 177.93.110.102
Port 80
Service
BackEnd
Address 127.0.0.1
Port 49967
End
@joubertredrat
joubertredrat / teste.php
Last active August 1, 2016 18:09
Como assim veio?
<?php
class Valor
{
public function getTimeStamp()
{
return time();
}
}
$a = new Valor();