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
/* Stepper Motor Driver -> Servo Adapter | |
Interpret direction and step pulses from GRBL or other stepper-driving software | |
and instead translate it to a PWM signal appropriate for a nice cheap standard | |
servo. Ideally we wouldn't use a whole extra arduino for this but GRBL is not | |
really set up to do this natively and I don't feel like hacking it. Off-brand | |
Arduino Nanos are a couple bucks each these days. ¯\_(ツ)_/¯ | |
*/ | |
#include <Servo.h> | |
// CONSTANTS |
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
#include <Servo.h> | |
// CONSTANTS | |
const byte MAX_POS = 180; | |
const byte SERVO_PIN = 9; | |
const byte STEP_PIN = 2; | |
const byte DIR_PIN = 3; | |
const byte NEG_LIMIT_PIN = 11; | |
const byte POS_LIMIT_PIN = 12; |
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
(ns lazybot.plugins.logicplayground | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic) | |
(:require clojure.core.logic.fd :as fd) | |
) | |
(comment | |
(run* [q] | |
(fresh [a b c d e f g h i j k l m n o p] |
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
(ns lazybot.plugins.dice | |
(:use lazybot.registry) | |
(:use lazybot.utilities) | |
(:require [clojure.string :as string]) | |
(:require [instaparse.core :as insta]) | |
(:require [clojure.core.match :refer [match]])) | |
; parser expects input like | |
; "3d20 + 2d4 + 10" | |
; and produces a list of structures like |
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
(ns lazybot.plugins.number-trivia | |
(:use [lazybot registry] | |
[lazybot.utilities]) | |
(:require [clj-http.client :as client])) | |
; http://numbersapi.com/ | |
; from API docs: | |
;;; Just hit http://numbersapi.com/number/type to get a plain text response, where | |
;;; type is one of trivia, math, date, or year. Defaults to trivia if omitted. | |
;;; number is |
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
extern crate serialize; | |
extern crate time; | |
// use std::str; | |
// use std::rand; | |
use std::io::{File, BufferedReader}; | |
use std::collections::TreeMap; | |
use serialize::{json, Encodable, Decodable}; | |
#[deriving(Decodable, Encodable, Show)] |
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
#SingleInstance Force | |
#MaxHotkeysPerInterval 99999 | |
#IfWinActive ahk_class DarkSouls2 | |
; AHL script to remove input lag from DarkSouls2 PC, and add hotkeys for | |
; Guard break / Jump Attack | |
; | |
; Current settings (some can be easily changed) | |
; LMB / RMB = normal attacks | |
; Shift + LMB / RMB = strong attacks |
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
(ns example.typetest | |
(:use [clojure.core.typed])) | |
; using [org.clojure/core.typed "0.2.13"] | |
(def-alias House "a House has some :people in it and maybe a :mortgage." | |
(HMap :mandatory {:id String | |
:people (Coll String) | |
} | |
; comment out this :optional line and it all works | |
:optional {:mortgage Number} |
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
(defn index-of | |
"return the index of the supplied item, or nil" | |
[v item] | |
(let [len (count v)] | |
(loop [i 0] | |
(cond | |
(<= len i) nil, | |
(= item (get v i)) i, | |
:else (recur (inc i )))))) |
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
// show a loading animation while AJAX requests are pending | |
angular | |
.module('loadingOnAJAX', []) | |
.config(function($httpProvider) { | |
var numLoadings = 0; | |
var loadingScreen = $('<div style="position:fixed;top:0;left:0;right:0;bottom:0;z-index:10000;background-color:gray;background-color:rgba(70,70,70,0.2);"><img style="position:absolute;top:50%;left:50%;" alt="" src="data:image/gif;base64,R0lGODlhQgBCAPMAAP///wAAAExMTHp6etzc3KCgoPj4+BwcHMLCwgAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAQgBCAAAE/xDISau9VBzMu/8VcRTWsVXFYYBsS4knZZYH4d6gYdpyLMErnBAwGFg0pF5lcBBYCMEhR3dAoJqVWWZUMRB4Uk5KEAUAlRMqGOCFhjsGjbFnnWgliLukXX5b8jUUTEkSWBNMc3tffVIEA4xyFAgCdRiTlWxfFl6MH0xkITthfF1fayxxTaeDo5oUbW44qaBpCJ0tBrmvprc5GgKnfqWLb7O9xQQIscUamMJpxC4pBYxezxi6w8ESKU3O1y5eyts/Gqrg4cnKx3jmj+gebevsaQXN8HDJyy3J9OCc+AKycCVQWLZfAwqQK5hPXR17v5oMWMhQEYKLFwmaQTDgl5OKHP8cQjlGQCHIKftOqlzJsqVLPwJiNokZ86UkjDg5emxyIJHNnDhtCh1KtGjFkt9WAgxZoGNMny0RFMC4DyJNASZtips6VZkEp1P |
NewerOlder