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
-- Purpose: Debug a single Java class from within LazyVim | |
-- Overview of steps: | |
-- 1. Update ~/.config/nvim/lua/config/lazy.lua to enable the 'Java Extra' | |
-- 2. Add new plugin config at ~/.config/nvim/plugins/debug_java.lua | |
-- 3. Test: Add break point, hit <leader>dA, Observe debugging in action. | |
-- Notes: | |
-- 1. Works for a single Java file, larger projects likely will need other steps or configuration | |
-- 2. Solution was found on Reddit, see reference 1. | |
-- References: | |
-- 1) Reddit: https://www.reddit.com/r/neovim/comments/subfv1/help_setting_up_debugger_for_java/ |
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
-- Purpose: | |
-- 1. Demonstrate configuring Telekasten with LazyVim 'plugin configuration' file. | |
-- 2. Add ability to create links to ... | |
-- - a heading under the cursor | |
-- - a specific line under the cursor (using a 'block reference') | |
-- - the file with a description entered at a prompt | |
-- 3. Demonstrate having a main vault and seperate one(s) for work | |
-- Usage: (look for 'TODO') | |
-- 1. Save as ~/.config/nvim/plugins/telekasten.lua | |
-- 2. Create directories for vault(s) |
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/env python | |
# Plays "silent night" on a piezo buzzer attached to pin 18 of the Onion Omega2 | |
# Things required: python lite, pwm needs to be enabled via: | |
# omega2-ctrl gpiomux set pwm0 pwm | |
from time import sleep | |
exportStr="/sys/class/pwm/pwmchip0/export" | |
periodStr="/sys/class/pwm/pwmchip0/pwm%s/period" | |
dutyStr="/sys/class/pwm/pwmchip0/pwm%s/duty_cycle" |
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 org.easymock.EasyMock; | |
import org.easymock.IAnswer; | |
import org.junit.Assert; | |
import org.junit.Test; | |
/* | |
* Demonstrate using EasyMock to mock a method argument modification. | |
*/ | |
// Dependency to mock... |
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
// Derived from http://stackoverflow.com/a/8545403/106786 | |
function decodeFloat(bytes, signBits, exponentBits, fractionBits, eMin, eMax, littleEndian) { | |
var totalBits = (signBits + exponentBits + fractionBits); | |
var binary = ""; | |
for (var i = 0, l = bytes.length; i < l; i++) { | |
var bits = bytes[i].toString(2); | |
while (bits.length < 8) | |
bits = "0" + bits; |
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
// Int64.js | |
// | |
// Copyright (c) 2012 Robert Kieffer | |
// MIT License - http://opensource.org/licenses/mit-license.php | |
/** | |
* Support for handling 64-bit int numbers in Javascript (node.js) | |
* | |
* JS Numbers are IEEE-754 binary double-precision floats, which limits the | |
* range of values that can be represented with integer precision to: |