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
bsx=77; | |
bsy=32; | |
// distance of screwhole to edge of pcb | |
screwdist=3.5; | |
screwr=1.75; | |
clearance=2; | |
wall=2; |
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
// 2,5 * 6 * 2 | |
module case(wall_thickness) { | |
// dimensions of the space inside | |
width = 30; | |
height = 60; | |
depth = 30; | |
difference() { | |
// shell | |
translate([-1 * wall_thickness, -1 * wall_thickness, -1 * wall_thickness]) |
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 <Wire.h> | |
#include "Adafruit_TMP007.h" | |
#include "esp_system.h" | |
#include "nvs_flash.h" | |
#include "nvs.h" | |
Adafruit_TMP007 tmp007; | |
nvs_handle nvs; | |
esp_err_t err; |
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
(ns funcall_perf) | |
(defn len1a [^String foo] (.length foo)) | |
(defn len1b [foo] (.length foo)) | |
(defn len2a [^String foo] (count foo)) | |
(defn len2b [foo] (count foo)) | |
; warm up | |
(doseq [func [len1a len1b len2a len2b]] | |
(dotimes [n 1000000] |
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 java.io.IOException; | |
import java.io.UncheckedIOException; | |
import java.util.function.Consumer; | |
import com.google.common.collect.ImmutableList; | |
public class Foo { | |
static interface IOExceptionConsumer<T> { |
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
Dir.glob('**/*java').map{|fn| expected = File.basename(fn).gsub(/\.java/, ''); [expected, open(fn){|f| if f.read=~/LoggerFactory.getLogger\((.+)\.class\)/; $1==expected; else; true; end}]}.reject{|fn, valid| valid} |
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 pynotify | |
>>> pynotify.init() | |
>>> pynotify.init('console') | |
True | |
>>> pynotify.Notification('foo') |
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 -e | |
function die() { | |
echo $1 >&2 | |
exit 0 | |
} | |
[[ -x $(which play) ]] || die "sox must be installed" | |
if [ $# -gt 0 ]; then |
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
def sum(arr) | |
res = 0 | |
arr.each{|e| res+=e} | |
res | |
end | |
def mult(arr) | |
res = 1 | |
arr.each{|e| res*=e} | |
res |
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
public class Singleton { | |
private static Singleton inst; | |
public static synchronized Singleton getInstance() { | |
if (inst==null) | |
inst = new Singleton(); | |
return inst; | |
} | |
private Singleton() { |
NewerOlder