Skip to content

Instantly share code, notes, and snippets.

View krolow's full-sized avatar

Vinícius Krolow krolow

View GitHub Profile
@krolow
krolow / countries.sql
Created February 3, 2012 16:38
Countries ISO SQL for MySQL / CakePHP
CREATE TABLE `countries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`printable_name` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=240 DEFAULT CHARSET=utf8;
@krolow
krolow / example-react-form-hook.js
Last active January 14, 2019 16:58
Simple react form using hooks
import React from 'react';
import { useRef } from 'react';
export default function AddMemberPage({ addMember }) {
const formRef = useRef();
async function handleSave(event) {
event.preventDefault();
@krolow
krolow / MetaTrait.php
Last active October 4, 2019 15:32
PHP Meta Programming PHP 5.4
<?php
trait MetaTrait
{
private $methods = array();
public function addMethod($methodName, $methodCallable)
{
if (!is_callable($methodCallable)) {
throw new InvalidArgumentException('Second param must be callable');
@krolow
krolow / gist:4529579ea0697a7e003bbe21a76ba8eb
Created May 5, 2024 15:35
Expo running on android emulator crashing when chrome was opening, the emulator was closing
Ubuntu 22.04.3
Expo running on android emulator crashing when chrome was opening, the emulator was closing
To solve added a file in ~/.android/advancedFeatures.ini
Vulkan = off
GLDirectMem = on