Skip to content

Instantly share code, notes, and snippets.

View suda's full-sized avatar
🍃

Wojtek Siudzinski suda

🍃
View GitHub Profile
@suda
suda / keybindings.json
Created December 16, 2018 11:44
VSCode Mac keybindings for Linux/Windows
// Overwrite key bindings by placing them into your key bindings file.
[
{
"key": "escape escape",
"command": "workbench.action.exitZenMode",
"when": "inZenMode"
},
{
"key": "shift+escape",
"command": "closeReferenceSearchEditor",
@suda
suda / RCSwitch.cpp
Created March 18, 2014 10:21
RCSwitch for Spark Core
/* ========================= .cpp ================================= */
/*
RCSwitch - Arduino libary for remote control outlet switches
Copyright (c) 2011 Suat Özgür. All right reserved.
Contributors:
- Andre Koehler / info(at)tomate-online(dot)de
- Gordeev Andrey Vladimirovich / gordeev(at)openpyro(dot)com
- Skineffect / http://forum.ardumote.com/viewtopic.php?f=2&t=46
[
{
"status": "Ocupado",
"price": "Gratuito"
},
{
"status": "Disponible",
"price": "0.45€/kWh"
}
]
#!/bin/sh
# PROVIDE: gitlab_runner
# REQUIRE: DAEMON NETWORKING
# BEFORE:
# KEYWORD:
. /etc/rc.subr
name="gitlab_runner"
rcvar="gitlab_runner_enable"
@suda
suda / user_config_override.h
Created January 4, 2021 13:07
Tasmota custom config for 512KB flash
/*
user_config_override.h - Tasmota user configuration overrides for 512KB flash
Copyright (C) 2021 Wojtek Siudzinski
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
#!/bin/bash
# Nvidia 430.26 installer, BETA.
SERVER="http://159.203.46.64"
ETHOSVERSION="1.3.3"
VERSION="430.26"
function f.checkdpkg(){
DPKGLOCKED=$(lsof /var/lib/dpkg/lock 2>/dev/null | grep -c "/var/lib/dpkg/lock"); WAITCOUNT="0"
if [ "$DPKGLOCKED" -ge "1" ];then
until [ "$DPKGLOCKED" = "0" ] || [ "$WAITCOUNT" = "60" ]; do
DPKGLOCKED=$(lsof /var/lib/dpkg/lock 2>/dev/null | grep -c "/var/lib/dpkg/lock"); ((WAITCOUNT++))
// This is a console to a ESP8266/ESP32 running on the device UART1.
// Allows you to type AT commands from your computer via the microcontroller.
//
// In other words:
// Your computer <--> UART0 <--> MCU <--> UART1 <--> ESP8266 <--> INTERNET
//
// More information on the Espressif AT command set at:
// https://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdf
//
package main
@suda
suda / gunicorn
Created December 20, 2010 12:38
Gunicorn init.d script (gentoo)
#!/sbin/runscript
# Gunicorn init.d script for gentoo
# Written by Wojtek 'suda' Siudzinski <admin@suda.pl>
# Gist: https://gist.github.com/748335
#
# Sample config (/etc/conf.d/gunicorn):
#
# SERVERS=(
# 'server_name port project_path number_of_workers'
@suda
suda / multipleRows.mm
Last active June 14, 2019 09:06
Multiple Row Selection in UIPickerView
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
UITableViewCell *cell = (UITableViewCell *)view;
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
[cell setBackgroundColor:[UIColor clearColor]];
[cell setBounds:CGRectMake(0, 0, cell.frame.size.width - 20, 44)];
cell.tab = row UITapGestureRecognizer * singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleSelection:)];
singleTapGestureRecognizer.numberOfTapsRequired = 1;
[cell addGestureRecognizer:singleTapGestureRecognizer];
}
#cloud-config
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+xU8Tzj7FHrTldT2SW2i3+VXO+nU+tijkSIePuxZscYMMdEv32JrsFQAIQF+4JrGCzuilqOOz/ewIAKH6v4xW0f2XTOhA6oqTaJWhIMlovIVQq8txnBpSHoldWiT8nqGElUQA6PpUgLVjwCaUUtKuGHV2JNAsKUMH724wSHqHxc9m/SHB9TksWM74fIw67rsY4GKaRv7M2pFqbr//VlEM2LxXVCxf0Zs3fiF33yiAHWHHlTm6Tu9Q8QhYu1ikpZ6/K4GOuWzyZJjt7nVRqYio4dKi/D6DpHy8LyACAQP3MlGx2gNeqKcQGZ7O63CkPVB1j87pnH1XYvG97Nc9xgCf suda@suda-imac.local"
coreos:
units:
- name: "influxdb.service"
command: "start"
content: |
[Unit]