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
// Base class for MCP23008 and MCP23017 family of I2C i/o expanders | |
class MCP230xx { | |
BASE_ADDR = 0x20 | |
i2cPort = null | |
i2cAddr = null | |
regs = null | |
constructor(i2cPort, deviceAddr) { | |
this.i2cPort = i2cPort | |
this.i2cAddr = (BASE_ADDR + deviceAddr) << 1 |
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
<link rel="import" href="../chart-js/chart-js.html"> | |
<link rel="import" href="../yt-video/yt-search-video.html"> | |
<link rel="import" href="../smoothie-chart/smoothie-chart.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
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
# -*- ~/.tmux.conf -*- | |
# | |
# - jeko@jeko.net - | |
# | |
set -g mode-mouse on | |
set -g monitor-activity on | |
set -g utf8 on | |
set -g mouse-select-pane on | |
set -g mouse-select-window on | |
set -g mouse-resize-pane on |
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
module ExtraMessageLogging | |
def do_something | |
super | |
puts "Prepend from #{self.class.name}" | |
end | |
end | |
module AnotherExtraMessageLogging | |
def do_something | |
super |
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
module HiddenLogger | |
def inject_log(method_name) | |
instance_exec(method_name) do |method_name| | |
def method_name_with_logging | |
method_name_without_logging | |
puts "Sarcazzo: #{@foo}" | |
end |
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
// Changes the RGB/HEX temporarily to a HSL-Value, modifies that value | |
// and changes it back to RGB/HEX. | |
function changeHue(rgb, degree) { | |
var hsl = rgbToHSL(rgb); | |
hsl.h += degree; | |
if (hsl.h > 360) { | |
hsl.h -= 360; | |
} | |
else if (hsl.h < 0) { |
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
// easy win @ http://10fastfingers.com/typing-test | |
setInterval( function(){ | |
$('#inputfield').val($(".highlight").html()); | |
$('#inputfield').trigger( | |
jQuery.Event('keyup', {which: 32}) | |
); | |
}, 100); |
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
// Visit The Stimulus Handbook for more details | |
// https://stimulusjs.org/handbook/introduction | |
// | |
// This example controller works with specially annotated HTML like: | |
// | |
// <h4>Tasks</h4> | |
// <div data-controller="nested-form"> | |
// <template data-target="nested-form.template"> | |
// <%= form.fields_for :tasks, Task.new, child_index: 'NEW_RECORD' do |task| %> | |
// <%= render "task_fields", form: task %> |
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
int redPin = 9; | |
int greenPin = 10; | |
int bluePin = 11; | |
int buttonPin = 2; | |
int buttonState = 0; | |
int lastButtonState = 0; | |
char cmdBuffer[2]; | |
int counter = 0; |
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
# Windows and WSL | |
def clip_copy(input) | |
str = input.to_s | |
IO.popen('clip.exe', 'w') { |f| f << str } | |
str | |
end | |
# Mac |
OlderNewer