Skip to content

Instantly share code, notes, and snippets.

View naaando's full-sized avatar
🏠
Working from home

Fernando da Silva Sousa naaando

🏠
Working from home
View GitHub Profile
@naaando
naaando / phpcs.xml
Created September 10, 2021 20:06
phpcs.xml
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>PHPCS configuration file.</description>
<!-- check all files in the app directory, feel free to add more files with:
<file>FOLDER NAME</file>
-->
<file>src</file>
<!-- exclude our migrations directory from the violation check-->
<?php
session_start();
require_once 'Classes/Conexao.php';
$bd = new Conexao();
if (isset($_POST['cadastrar'])) {
$email = filter_input(INPUT_POST,'email',FILTER_SANITIZE_STRING);
$senha = filter_input(INPUT_POST,'telefone',FILTER_SANITIZE_STRING);
if (!empty($nome) && !empty($senha) ) {
if (var_dump($bd->logarUsuario($email,$senha))) {
@naaando
naaando / multiple_ssh_setting.md
Created October 7, 2020 13:34 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
public void some_method (Pomodoro.Service ps) {
pomodoro_service.start.connect (on_pomodoro_service_started);
pomodoro_service.stop.connect ((state) => {
cancellable.cancel ();
start_n_stop_stack.visible_child_name = "start-button";
});
}
void on_pomodoro_service_started (Pomodoro.State state) {
state_label.set_pomodoro_state (state);
void on_pomodoro_service_started (Pomodoro.State state) {
state_label.set_pomodoro_state (state);
cancellable = new Cancellable ();
Timeout.add (500, () => {
timer_label.set_time_in_seconds (pomodoro_service.timer.get_remaining_time ());
return !cancellable.is_cancelled ();
});
print (@"Pomodoro started\n");
public virtual signal void start (State state = State.WORKING) {
running = true;
if (current_pomodoro != null) {
current_pomodoro.end ();
}
current_pomodoro = new Pomodoro (state);
seq.push_state (state);
@naaando
naaando / Facade.cs
Last active December 17, 2018 15:37
Vala Facade example
public interface Pomodoro.Service : Object {
public State get_next_state ();
public int count_state (State state);
public uint count_time_per_state (State state);
public void start_next () { start (seq.next_state ()); }
public void start_work () { start (State.WORKING); }
public void start_short_break () { start (State.SHORT_BREAK); }
public void start_long_break () { start (State.LONG_BREAK); }
public virtual signal void start (State state = State.WORKING);
public void pause ();
//author gavr https://www.youtube.com/channel/UChHL_HIocsBbeLGhi50bSvw?view_as=subscriber
//compile with valac --pkg gtk+-3.0 TreeViewExample.vala
using Gtk;
public class StackClass : Gtk.Window {
public Gtk.LevelBar[] barMass;
public Gtk.Frame box3;
private CustomWidget widget;
public StackClass () {
var header = new Gtk.HeaderBar();
header.set_show_close_button(true);
@naaando
naaando / patch-keyboardfix.sh
Created February 18, 2018 19:20
Patch accent fix for qt apps
#!/bin/bash
function remove_ibus {
cat $1 | grep -v "ibus" $1 > $1
}
# Fix keyboard accents
echo "Disabling ibus daemon..."
remove_ibus ~/.xprofile
remove_ibus ~/.profile
@naaando
naaando / patch-keyboardfix.sh
Created February 18, 2018 19:20
Patch accent fix for qt apps
#!/bin/bash
function remove_ibus {
cat $1 | grep -v "ibus" $1 > $1
}
# Fix keyboard accents
echo "Disabling ibus daemon..."
remove_ibus ~/.xprofile
remove_ibus ~/.profile