This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local math = math | |
local horiz3 = { | |
name = "horiz3" | |
} | |
function split_horizontal(g) | |
g.width = g.width / 2 | |
return { | |
x = g.x + g.width, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/network/networkd-wifi.c b/src/network/networkd-wifi.c | |
index 14a8687458..12cf4eda23 100644 | |
--- a/src/network/networkd-wifi.c | |
+++ b/src/network/networkd-wifi.c | |
@@ -35,7 +35,7 @@ int wifi_get_info(Link *link) { | |
_cleanup_free_ char *ssid = NULL; | |
r = wifi_get_interface(link->manager->genl, link->ifindex, &link->wlan_iftype, &ssid); | |
if (r < 0) | |
- return r; | |
+ return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/electron | |
module.paths.push("/usr/lib64/node_modules"); | |
const path = require("path"); | |
const {app, globalShortcut, BrowserWindow} = require('electron'); | |
const contextMenu = require('electron-context-menu'); | |
var mainWindow = null; | |
contextMenu(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# addn-hosts=/var/lib/misc/dhcp-hosts | |
# dhcp-script=/etc/dnsmasq.sh | |
ADDN_HOSTS=/var/lib/misc/dhcp-hosts | |
case "$1" in | |
"add" ) echo "$3" `echo $2 | sed 's/://g'`.dhcp > $ADDN_HOSTS/$3 ;; | |
"del" ) rm -f $ADDN_HOSTS/$3 ;; | |
"old" ) exit ;; | |
esac | |
echo `date` $1 $2 $3 >> /var/log/dnsmasq.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import os,sys,argparse | |
import paho.mqtt.client as mqtt | |
import mdns_resolver | |
dirname = os.path.dirname(os.path.abspath(__file__)) | |
nodename = "unknown-node" | |
force_check_topic = "gearchange-force-check" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import machine,network | |
lan = network.LAN(id = None, mdc = machine.Pin(23), mdio = machine.Pin(18), power = machine.Pin(2), phy_addr = 1, phy_type = network.PHY_LAN8720) | |
lan.active(1) | |
lan.ifconfig() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <esp_private/wifi.h> | |
#include <netif/wlanif.h> | |
static esp_err_t tcpip_adapter_sta_input(void *buffer, uint16_t len, void *eb) | |
{ | |
if (destination_mac_address_belongs_to_eth) { | |
esp_eth_tx(buffer, len); | |
esp_wifi_internal_free_rx_buffer(eb); | |
return ESP_OK; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ports/esp32/Makefile b/ports/esp32/Makefile | |
index 36ee4b3b0..3af707a13 100644 | |
--- a/ports/esp32/Makefile | |
+++ b/ports/esp32/Makefile | |
@@ -178,6 +178,7 @@ SRC_C = \ | |
machine_dac.c \ | |
machine_pwm.c \ | |
machine_uart.c \ | |
+ native_memory.c \ | |
modmachine.c \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math,time,machine,utime | |
pin25 = machine.Pin(25, machine.Pin.OUT) | |
pin26 = machine.Pin(26, machine.Pin.OUT) | |
dac0 = machine.DAC(pin25) | |
dac1 = machine.DAC(pin26) | |
while True: | |
s = math.sin(utime.ticks_ms() / 1000.0) | |
dac0.write(int(127 * (s + 1.0) / 2) + 128) | |
dac1.write(int(127 * (-s + 1.0) / 2) + 128) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin,SPI | |
from ssd1306 import SSD1306_SPI | |
oled = SSD1306_SPI(128, 64, SPI(2,sck=Pin(18),mosi=Pin(23), miso=Pin(19)),dc=Pin(2),res=Pin(4),cs=Pin(5)) | |
oled.text('Hello, World!', 0, 0) | |
oled.show() |