Skip to content

Instantly share code, notes, and snippets.

View nstCactus's full-sized avatar
🌵

nstCactus nstCactus

🌵
  • La Haute Société
  • Passy, France
View GitHub Profile
@nstCactus
nstCactus / .gitconfig
Created February 7, 2024 09:11
macOS .gitconfig
#[url "git@github.com:"]
# insteadOf = https://github.com/
[user]
email = yohann.b@lahautesociete.com
name = Yohann Bianchi
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzyAlx5KjceHkIp2cg9nKNkA8K+kRNH/ckJutCkqiPL
[push]
default = simple
@nstCactus
nstCactus / ddev_wrong_command.py
Created February 7, 2024 09:04
A thefuck rule to correct typos in DDEV commands
import subprocess
from thefuck.utils import replace_command, for_app, eager, get_closest, which
enabled_by_default = bool(which('ddev'))
def _get_wrong_command(script_parts):
commands = [part for part in script_parts[1:] if not part.startswith('-')]
if commands:
return commands[0]
@nstCactus
nstCactus / proto_rpi_lcd_temperature.js
Last active April 14, 2020 20:51
Display the current temperature read from a ds18b20 sensor on a 16x2 character LCD screen.
#!/usr/bin/env node
// imports
const ds18b20 = require('ds18b20-raspi');
const LCD = require('lcd');
// sensor instances
const lcd = new LCD({ rs: 18, e: 17, data: [27, 23, 24, 22], cols: 16, rows: 2 });
const SENSOR_ID = '28-800000285247';
<?php
namespace modules;
use benf\neo\Field;
use Craft;
use markhuot\CraftQL\Builders\EnumField;
use markhuot\CraftQL\Builders\EnumObject;
use markhuot\CraftQL\Builders\Union;
use yii\base\Event;
var gpio = require('pi-gpio');
var pins = { 38: 0, 40: 0 };
var intervals = [];
console.log("Ready");
for(var i in pins){
var pin = i;