Skip to content

Instantly share code, notes, and snippets.

View Couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto Couto

👽
Did you raid area 51?
View GitHub Profile
// Uses CommonJS, AMD or browser globals to create a module.
// If you just want to support Node, or other CommonJS-like environments that
// support module.exports, and you are not creating a module that has a
// circular dependency, then see returnExports.js instead. It will allow
// you to export a function as the module value.
// Defines a module "commonJsStrict" that depends another module called "b".
// Note that the name of the module is implied by the file name. It is best
// if the file name and the exported global have matching names.
@Couto
Couto / neotest.lua
Created October 30, 2023 08:32
neotest.lua
return {
"nvim-neotest/neotest",
cond = not vim.g.vscode,
config = function()
-- get neotest namespace (api call creates or returns namespace)
local neotest_ns = vim.api.nvim_create_namespace("neotest")
vim.diagnostic.config({
virtual_text = {
format = function(diagnostic)
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
@Couto
Couto / docker-compose-ce.yaml
Created July 17, 2023 09:31
Passbolt docker-compose with default envs
version: "3.9"
services:
db:
image: mariadb:10.11
restart: unless-stopped
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "true"
MYSQL_DATABASE: "${MYSQL_DATABASE:-passbolt}"
MYSQL_USER: "${MYSQL_USER:-passbolt}"
MYSQL_PASSWORD: "${MYSQL_PASSWORD:-passbolt}"
@Couto
Couto / DOMElementCreate.js
Created September 5, 2012 14:17
create DOM Elements through a CSS Selector
/**
* $$ - Creates a DOM Element with the given attributes
*
* @author Luis Couto <couto@15minuteslate.net> (https://github.com/Couto)
* @license MIT (http://couto.mit-license.org)
*
* @function
* @param {String} selector CSS Selector representing the HTML and attributes
* @returns {Node} HTML Element
*
@Couto
Couto / gist:4eedfa4b3d2ff58985389f316b1ece83
Last active April 17, 2022 16:39
Fix GPS settings in One Plus One with LineageOS

Connect to the phone via adb

adb shell

Request root access (has to be enabled in Developer settings).
Re-mount the /system with write permissions.
Edit the relevant configurations.

su
@Couto
Couto / package.json
Last active February 13, 2022 22:16
Test case for file uploads with Hapi.js. Currently failing when same request is made with a simple JSON.
{
"name": "file-upload",
"version": "1.0.0",
"description": "File Upload test case",
"main": "server.js",
"dependencies": {
"hapi": "^8.0.0-rc8",
"joi": "^5.0.2"
},
"devDependencies": {
@Couto
Couto / Dockerfile
Last active October 26, 2021 11:24
Install SphereServer X using docker
FROM debian:buster-slim
WORKDIR /sphere
RUN apt-get update --fix-missing \
&& apt-get install -y \
curl \
mysql-common \
&& apt-get clean;
@Couto
Couto / webpack.js
Last active November 11, 2020 17:53
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@Couto
Couto / readme.md
Created March 23, 2020 18:18
Storybook Typescript Path alias example

asd

@Couto
Couto / Preferences.sublime-settings
Created July 29, 2012 17:19
Sublime Text 2 - User Preferences
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Themes/Espresso Soda/Espresso Soda.tmTheme",
// Note that the font_face and font_size are overriden in the platform