View com.judepereira.keyremapping.plist
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.judepereira.keyremapping</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/hidutil</string> | |
<string>property</string> |
View Test.java
This file contains 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
class State { | |
public static boolean someState; | |
} | |
class GoodTest { | |
@Test | |
public void checkState() { | |
assertFalse(State.someState); | |
} |
View TameAThrottledAPI.java
This file contains 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
MyStubbornAPIInterface actualInstance = ... // Create it however you'd create your original instance. | |
MyStubbornAPIInterface proxiedInstance = (MyStubbornAPIInterface) Proxy.newProxyInstance(actualInstance.getClass().getClassLoader(), | |
new Class[]{MyStubbornAPIInterface.class}, (proxy, method, args) -> { | |
while (true) { | |
try { | |
return method.invoke(actualInstance, args); | |
} catch (MyThrottlingException e) { | |
try { | |
Thread.sleep(ThreadLocalRandom.current().nextInt(1, 5) * 1000L); | |
} catch (InterruptedException e) { |
View ota.sh
This file contains 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 | |
# Wrapper script for sending OTA updates to your ESP8266 running NodeMCU. | |
# See https://judepereira.com/blog/sending-ota-updates-over-wifi-to-your-esp8266/ | |
HOST=192.168.178.25 | |
PORT=8080 | |
for i in "$@"; do | |
FILE=$i |
View ota.lua
This file contains 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
-- Send OTA updates to remotely update lua scripts on your ESP8266. | |
-- | |
-- LICENCE: http://opensource.org/licenses/MIT | |
-- Created by Jude Pereira <contact@judepereira.com> | |
-- See https://judepereira.com/blog/sending-ota-updates-over-wifi-to-your-esp8266/ | |
srv = net.createServer(net.TCP) | |
current_file_name = nil |
View a.story
This file contains 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
http server as server | |
when server listen path: "/" as req | |
current = (redis get key: "count").result | |
if current == null | |
current = 0 | |
current = current + 1 | |
redis set key: "count" value: current | |
req write content: "This page has loaded {current} times.<br>Powered by https://gist.github.com/judepereira/c45f9080def481c0917af77c6b9e9d11" |
View a.txt
This file contains 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
h2:Adafruit_nRF52_Bootloader jude$ git status | |
On branch master | |
Your branch is up to date with 'origin/master'. | |
Changes not staged for commit: | |
(use "git add <file>..." to update what will be committed) | |
(use "git checkout -- <file>..." to discard changes in working directory) | |
modified: Makefile | |
modified: src/main.c |
View a.diff
This file contains 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 diff ~/developer/em/nRF5_SDK_15.3.0_59ac345/examples/ant/ant_plus/ant_bsc/bsc_tx/pca10040/s212/armgcc/ant_bsc_tx_gcc_nrf52.ld ~/developer/em/bia/src/ant_bsc_tx_gcc_nrf52.ld | |
8,9c8,9 | |
< FLASH (rx) : ORIGIN = 0x12000, LENGTH = 0x6e000 | |
< RAM (rwx) : ORIGIN = 0x20000b80, LENGTH = 0xf480 | |
--- | |
> FLASH (rx) : ORIGIN = 0x00031000, LENGTH = 0x000F4000-0x00031000 | |
> RAM (rwx) : ORIGIN = 0x20002000, LENGTH = 0xf480 |
View INFO_UF2.TXT
This file contains 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
UF2 Bootloader 0.2.10-4-g79fe6cc-dirty lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s340 6.1.1 | |
Model: SparkFun Pro nRF52840 Mini | |
Board-ID: SparkFun-Pro-nRF52840-Mini | |
Bootloader: s340 6.1.1 | |
Date: Jul 12 2019 |
View tree.sh
This file contains 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
$ tree lib/softdevice/s340_nrf52_6.1.1/ | |
lib/softdevice/s340_nrf52_6.1.1/ | |
├── s340_nrf52_6.1.1_API | |
│ └── include (all header files must be under here) | |
└── s340_nrf52_6.1.1_softdevice.hex |
NewerOlder