Skip to content

Instantly share code, notes, and snippets.

Fernando Basso FernandoBasso

Block or report user

Report or block FernandoBasso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
FernandoBasso /
Created Apr 19, 2018
python html.parser
class MyHTMLParser(HTMLParser):
def __init__(self):
self.isTags = False
self.tags = None
def handle_starttag(self, tag, attrs):
if tag == 'p':
if containsAttr(attrs, 'class', 'tags'):
self.isTags = True
View App.vue
<v-list class="main-navigation-drawer">
FernandoBasso / CategoryIndex.spec.js
Last active Jan 31, 2018
testing vuetify components
View CategoryIndex.spec.js
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import CategoryIndex from '../../../src/components/CategoryIndex.vue';
describe('CategoryIndex', function () {
let wrp;
beforeEach(() => {
wrp = mount(CategoryIndex);
FernandoBasso / Foo.spec.js
Created Jan 30, 2018
vuejs test emitted events with sinon spy
View Foo.spec.js
import Vue from 'vue';
import Foo from '../src/components/Foo.vue';
import expect from 'expect';
import sinon from 'sinon';
import { mount } from '@vue/test-utils';
// Can comment out the mocks property and use this. Both work.
// Vue.prototype.$ebus = new Vue();
describe('Foo', () => {
View the-little-schemer.scm
(require-extension test) ; chicken-install -s test
;; Expr -> Bool
;; Takes an expression and produce #t if it is an atom; #f otherwise.
;; NOTE:
;; Chicken has its own implementation of atom?. It produces
;; `#t` for '(). This version (from the book) produces #f for '().
FernandoBasso / brilliant.js
Created Oct 18, 2017
Marvelous piece of javascript found in a legacy project I am maintaining
View brilliant.js
function foco(formulario){
elementos = document.getElementById(formulario).elements;
for (i=0; i<elementos.length; i++) {
if (elementos[i].hasAttribute("setFocus")) {
obr = elementos[i].getAttribute("type");
if(obr == "text") elementos[i].select(); else elementos[i].focus();
View inclues-in-blade.blade.php
@section('title', 'Cadastrar Nova Postagem')
<div class="crud posts edit">
{{-- This doesn't show up either if the Form is there --}}
what the fuck?
FernandoBasso / Admin.php
Last active Oct 15, 2017
catch not catching ...
View Admin.php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class Admin
FernandoBasso / tic-tac-toe-possible-boards.rkt
Last active Oct 17, 2017
Find possible board combinations
View tic-tac-toe-possible-boards.rkt
#lang htdp/isl+
;; Fetches `list-ref`, `take` and `drop`.
(require racket/list)
; Below you will find some data definitions for a tic-tac-toe solver.
; In this problem we want you to design a function that produces all
; possible filled boards that are reachable from the current board.
View tic-tac-toe.txt
In this problem we want you to design a function that produces all
possible filled boards that are reachable from the current board.
In actual tic-tac-toe, O and X alternate playing. For this problem
you can disregard that. You can also assume that the players keep
placing Xs and Os after someone has won. This means that boards that
are completely filled with X, for example, are valid.
NOTE: It was said that there would be 512 possible filled in boards
following the description above.
You can’t perform that action at this time.