Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sequoya42 on github.
  • I am sequoya (https://keybase.io/sequoya) on keybase.
  • I have a public key ASAlYfE2LOOOcDTZt06giVbJeSWj7SCH7-KOV4_7DKScNwo

To claim this, I am signing this object:

const removeDuplicate = (arr, key, value, nkey = key, nvalue = value) => {
const bail = arr.reduce((a, b) => Object.assign(a, { [b[key]]: b[value] }));
return Object.keys(bail).map(key => ({
[nkey]: key,
[nvalue]: bail[key]
}));
};
@Sequoya42
Sequoya42 / testJsonSql.js
Last active May 28, 2018 20:51
get data as JSON sql
const whatIWant = {
username: 'u.username',
uid: 'u.id',
network: 'p.network'
};
let testJsonSql = whatIwant => {
let ret = '"{",';
for (k in whatIwant) {
ret += ` '"', "${k}" , '":"', ${whatIwant[k]}, '",'`;
@Sequoya42
Sequoya42 / rotate.sh
Created August 5, 2017 22:08
arch_tool
#!/bin/bash
# Auto rotate screen based on device orientation
# based on https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu
# install
# 1. apt-get install iio-sensor-proxy inotify-tools
# 2. add script to autostart
# Receives input from monitor-sensor (part of iio-sensor-proxy package)
# Screen orientation and launcher location is set based upon accelerometer position
function makeSchema(x) {
if (Array.isArray(x)) return x.map(k => makeSchema(k));
else if (typeof x === 'boolean') return true;
else if (typeof x === 'number') return 1;
else if (typeof x === 'string') return 'string';
else if (typeof x === 'object') {
let obj = {};
for (let k in x) {
obj[k] = makeSchema(x[k]);
}
@Sequoya42
Sequoya42 / cloudSettings
Last active October 5, 2020 13:52
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-10-05T13:52:13.437Z","extensionVersion":"v3.4.3"}
/*
Requires to have eslint and eslint-plugin vue installed locally.
(npm i -g eslint eslint-plugin-vue)
https://vuejs.github.io/eslint-plugin-vue/rules/
Put this in a ".eslintrc.json" at the root of the repository.
You can also put in in your $HOME.
*/
/*
Requires to have eslint and eslint-plugin vue installed locally.
(npm i -g eslint eslint-plugin-vue)
https://vuejs.github.io/eslint-plugin-vue/rules/
Put this in a ".eslintrc.json" at the root of the repository.
You can also put in in your $HOME.
*/