Skip to content

Instantly share code, notes, and snippets.

View dakoctba's full-sized avatar
🇧🇷
"Simplicity is the ultimate sophistication" - Leonardo da Vinci

Jackson Teixeira dakoctba

🇧🇷
"Simplicity is the ultimate sophistication" - Leonardo da Vinci
View GitHub Profile

if you receive the follow message:

could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"

...just install build-essential

sudo apt-get install build-essential

To fix Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1": dial unix /var/run/docker.sock: connect: permission denied error, follow de next steps:

sudo groupadd docker
sudo usermod -aG docker ${USER}
sudo chmod 666 /var/run/docker.sock

logoff + login

@dakoctba
dakoctba / release-android-debuggable.md
Created August 18, 2020 00:55 — forked from nstarke/release-android-debuggable.md
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@dakoctba
dakoctba / AppConfig.java
Last active January 22, 2024 11:58
Spring Boot + JDBI + Multiple Databases
import java.util.List;
import javax.sql.DataSource;
import org.jdbi.v3.core.Jdbi;
import org.jdbi.v3.core.mapper.RowMapper;
import org.jdbi.v3.core.spi.JdbiPlugin;
import org.jdbi.v3.sqlobject.SqlObjectPlugin;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
@dakoctba
dakoctba / cypress_localstorage.md
Last active June 5, 2019 16:37
Cypress and localStorage
// Colar esses comandos no arquivo cypress/support/index.js
Cypress.Commands.add('saveLocalStorage', () => {
  Object.keys(localStorage).forEach(key => {
    LOCAL_STORAGE_MEMORY[key] = localStorage[key];
  });
});

Cypress.Commands.add('restoreLocalStorage', () => {
 Object.keys(LOCAL_STORAGE_MEMORY).forEach(key => {

@angular/cli no Ubuntu

sudo npm install --unsafe-perm -g @angular/cli

@dakoctba
dakoctba / gist:7377d540af76a4f88650b71fc38c7a01
Last active April 7, 2017 09:54
Module build failed: Error: (...) mozjpeg/vendor/cjpeg: Syntax error: ")" unexpected

If you received the following error:

ERROR in ./assets/big.jpg
Module build failed: Error: /home/vagrant/apps/webpack-tests/node_modules/mozjpeg/vendor/cjpeg: 1: /home/vagrant/apps/webpack-tests/node_modules/mozjpeg/vendor/cjpeg: Syntax error: ")" unexpected

    at Promise.all.then.arr (/home/vagrant/apps/webpack-tests/node_modules/execa/index.js:201:11)
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/image_viewer.js 3:11-39
 @ ./src/index.js
@dakoctba
dakoctba / my-component.spec.js
Created January 16, 2017 19:32 — forked from thevangelist/my-component.spec.js
The only React.js component test you'll ever need (Enzyme + Chai)
import React from 'react';
import { shallow } from 'enzyme';
import MyComponent from '../src/my-component';
const wrapper = shallow(<MyComponent/>);
describe('(Component) MyComponent', () => {
it('renders without exploding', () => {
expect(wrapper).to.have.length(1);
});

Rails reset ALL Postgres sequences


ActiveRecord::Base.connection.tables.each do |t|
    ActiveRecord::Base.connection.reset_pk_sequence!(t)

end

@dakoctba
dakoctba / gist:d5c4f7e022e96a630eff
Created June 7, 2015 00:50
ppa error on ElementaryOS
sudo add-apt-repository --remove ppa:versable/elementary-update