Skip to content

Instantly share code, notes, and snippets.

View AshUK's full-sized avatar
💻
building...

Ash AshUK

💻
building...
View GitHub Profile
@AshUK
AshUK / setting.json
Last active July 23, 2020 20:12
esp-idf-tools-vs-code-path
{
"idf.espIdfPath": "/Users/ash/dev/esp/esp-idf",
"idf.customExtraPaths": "/Users/ash/Library/Python/2.7/bin:/Library/Python/2.7/site-packages:/Users/ash/.espressif/tools/openocd-esp32/v0.10.0-esp32-20190313/openocd-esp32/bin:/Users/ash/.espressif/tools/esp32ulp-elf/2.28.51.20170517/esp32ulp-elf-binutils/bin:/Users/ash/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin:/Users/ash/dev/esp/esp-idf/components/partition_table/:/Users/ash/dev/esp/esp-idf/components/espcoredump:/Users/ash/dev/esp/esp-idf/components/esptool_py/esptool:/Users/ash/dev/esp/esp-idf/tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin",
"idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"/Users/ash/.espressif/tools/openocd-esp32/v0.10.0-esp32-20190313/openocd-esp32/share/openocd/scripts\"}",
"idf.port": "/dev/tty.usbserial-1412401",
"idf.openOcdConfigs": ["interface/ftdi/esp32_devkitj_v1.cfg", "board/esp-wroom-32.cfg"]
}
@AshUK
AshUK / c_cpp_properties.json
Last active August 15, 2019 12:03
esp32 vscode settings
{
"configurations": [
{
"name": "ESP32",
"includePath": [
"${workspaceRoot}",
"${workspaceRoot}/main",
"${workspaceRoot}/main/include",
"${workspaceRoot}/build",
"${workspaceRoot}/build/include",
@AshUK
AshUK / hexStringToPadded.js
Last active July 11, 2019 15:03
hex string to padded hex
const toHex = text => {
const arr = text.match(/.{1,2}/g)
return `0x${arr.join(', 0x')}`
}
const stringValue = "69bff87ecc81b87ba4a6cfc9ef827303fe60e2adafe7627102fd744b490b2af1"
console.log(toHex(stringValue))
{
"Use Non-ASCII Font" : true,
"Tags" : [
],
"Ansi 12 Color" : {
"Red Component" : 0.3803921639919281,
"Color Space" : "Calibrated",
"Blue Component" : 0.93725490570068359,
"Alpha Component" : 1,
import { colors } from '@material-ui/core';
let pallete = [];
for (const color in colors) {
for (const hue in colors[color]) {
pallete.push(`$${color}${hue}: ${colors[color][hue]};`);
}
}
console.log(pallete.join('\n'));
@AshUK
AshUK / Installation.md
Last active April 1, 2019 10:19 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@AshUK
AshUK / .eslintrc
Last active April 1, 2019 10:14
eslint for js and react
{
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
{
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"workbench.iconTheme": "vscode-icons",
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code",
@AshUK
AshUK / LDAPTimeStampsToDate.js
Created September 29, 2016 14:20
Active Directory - LDAP Time Stamps to JS Date()
function LdapTimeStapToDate(ldapTimeStamp) {
var sec = Math.round(ldapTimeStamp / 10000000);
sec -= 11644473600;
return new Date(sec * 1000);
}
function Ldap2TimeStapToDate(ldap) {
var year = ldap.substr(0, 4);
var month = ldap.substr(4, 2);
var day = ldap.substr(6, 2);