Skip to content

Instantly share code, notes, and snippets.

View vforge's full-sized avatar
🔜
Great things!

Bartosz V. Bentkowski vforge

🔜
Great things!
View GitHub Profile
@t0ny-peng
t0ny-peng / README.md
Last active March 11, 2024 02:56
How to use the Home Assistant Toyota NA integration

The original repository of toyota-na was removed following a DMCA takedown notice, as detailed here. Consequently, the integration featured in this tutorial will not function for legal reasons. I regret to say I can no longer offer updates related to this tutorial. It has been a rewarding experience working on this project, and I am confident that you will discover alternative solutions to make it operational.

How to use the Home Assistant Toyota NA integration

@ssddanbrown
ssddanbrown / export-books.php
Last active November 20, 2024 13:05
BookStack-Export-Books
#!/usr/bin/env php
<?php
// API Credentials
// You can either provide them as environment variables
// or hard-code them in the empty strings below.
$apiUrl = getenv('BS_URL') ?: ''; // http://bookstack.local/
$clientId = getenv('BS_TOKEN_ID') ?: '';
$clientSecret = getenv('BS_TOKEN_SECRET') ?: '';
@witnessmenow
witnessmenow / PixelTimeAnalog.ino
Last active September 25, 2019 19:09
PixelTimeAnalog
#include <PxMatrix.h>
#ifdef ESP32
#define P_LAT 22
#define P_A 19
#define P_B 23
#define P_C 18
#define P_D 5
views:
- icon: 'mdi:home-variant'
cards:
- card:
show_header_toggle: false
type: entities
entities:
- group_config:
secondary_info: last-changed
type: 'custom:fold-entity-row'
@mszabo-wikia
mszabo-wikia / kubekurwa.sh
Last active February 2, 2021 02:32
like gitkurwa, but for k8s ☸️
#!/bin/bash
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: kubekurwa [context] [command] [...arguments]"
exit 1
fi
CONTEXT=kube-$1
COMMAND=$2
[profile]
layer_height = 0.15
wall_thickness = 1.2
retraction_enable = True
solid_layer_thickness = 1.2
fill_density = 15
print_speed = 50
print_temperature = 200
print_temperature2 = 0
print_temperature3 = 0
@cognitom
cognitom / quickstart.js
Last active June 4, 2024 04:16
Unspaghetti version of Google Spreadsheet API example code
import {readFile, writeFile, mkdir} from 'mz/fs'
import readline from 'mz/readline'
import promisify from 'es6-promisify'
import google from 'googleapis'
import googleAuth from 'google-auth-library'
import clientSecret from './client_secret.json'
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/sheets.googleapis.com-nodejs-quickstart.json
const SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly']
@myshov
myshov / function_invocation.js
Last active August 19, 2024 12:23
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@ljharb
ljharb / array_iteration_thoughts.md
Last active April 15, 2025 03:33
Array iteration methods summarized

Array Iteration

https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu

@vforge
vforge / TransparentFiles.json
Last active November 7, 2016 20:31
Transparent GIFs and other files
{
"16x9": "data:image/gif;base64,R0lGODlhEAAJAIAAAP///////yH5BAEKAAEALAAAAAAQAAkAAAIKjI+py+0Po5yUFQA7",
"1x1": "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
}