Skip to content

Instantly share code, notes, and snippets.

@danpolanco
danpolanco / gist:5915380
Last active December 19, 2015 06:59
Udev rules for automatic start and stop cfheadless for crazyflie. Work in progress.
Before:
SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev"
After (do not use as I made it up):
SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev", FILE="udev_script.sh"
Closer to correct:
SUBSYSTEM=="usb", ATTRS{idVendor}=="1915", ATTRS{idProduct}=="7777", MODE="0664", GROUP="plugdev", RUN+="/path/to/script"
Final:
@danpolanco
danpolanco / gist:0ce88d0e50c181749cdc
Created October 7, 2014 19:08
Vim rmarkdown and knitr
I made this short function to process my rmarkdown files:
> function MarkIt()
> :n **/*.Rmd
> :bufdo silent! cd %:p:h && Rscript -e "library(rmarkdown); render('%:p')"
> :redraw!
> endfunction
It still needs testing and so forth, but I didn't want to lose it.
if (NOT INSTALLING)
set (WORKING DIRECTORY "${CMAKECURRENTBINARYDIR}/Install")
file (MAKEDIRECTORY "${DIRECTORY}")
executeprocess (COMMAND "${CMAKECOMMAND}"
-DINSTALLING=TRUE
-DINSTALLPREFIX=${MYINSTALLPREFIX} "${CMAKECURRENTSOURCEDIR}"
WORKING_DIRECTORY "${DIRECTORY}"
)
executeprocess (COMMAND "${CMAKECOMMAND}"
--build .
#include <iostream>
#include <string>
#include <map>
using namespace std;
#include <json.hpp>
using json = nlohmann::json;
int main() {
json j_currencies = {

Keybase proof

I hereby claim:

  • I am DanTheColoradan on github.
  • I am danielpolanco (https://keybase.io/danielpolanco) on keybase.
  • I have a public key whose fingerprint is 73C9 955F C430 9458 D20F 8BF5 3056 8958 FCA1 7704

To claim this, I am signing this object:

---- Minecraft Crash Report ----
WARNING: coremods are present:
LoadingPlugin (Bloodmoon-1.2.jar)
Contact their authors BEFORE contacting forge
// Ooh. Shiny.
Time: 7/8/15 10:21 PM
Description: Ticking entity
@danpolanco
danpolanco / ExampleAlignSpec.hs
Created March 9, 2016 04:37
I don't understand how to test for Maybe yet.....
let validScorecard = Align.Scorecard {Align.match = 1, Align.mismatch = -1, Align.gap = 0}
let stalemateScorecard = Align.Scorecard {Align.match = 0, Align.mismatch = 0, Align.gap = 0}
describe "Align.validateScorecard" $ do
context "with a valid scorecard" $ do
it "returns Just the scoredcard" $ do
Align.validateScorecard validScorecard `shouldBe` Just validScorecard
context "with a scorecard that would lead to a stalemate" $ do
it "returns Nothing" $ do
Align.validateScorecard stalemateScorecard `shouldBe` (Nothing :: Maybe Align.Scorecard)
@danpolanco
danpolanco / 0_reuse_code.js
Created August 30, 2017 21:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@danpolanco
danpolanco / sr2ConsoleBugApr282020.txt
Created April 28, 2020 17:50
Macos Console logging errors and freezing
This file has been truncated, but you can view the full file.
Date/Time: 2020-04-27 23:19:37 -0600
End time: 2020-04-27 23:19:40 -0600
OS Version: Mac OS X 10.15.5 (Build 19F62f)
Architecture: x86_64h
Report Version: 29
Data Source: KPerf Lightweight PET
Shared Cache: 0x35c5000 C87D2436-C9E8-3E3F-A8BA-51783043ABA9
Reason: Slow response to HID event