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
walktree :: Tree -> Counter Tree | |
walktree (Node left right) = do | |
left' <- walktree left | |
right' <- walktree right | |
return (Node left' right') | |
--walktree (Node left right) = | |
-- walktree left >>= \left' -> | |
-- walktree right >>= \right' -> | |
-- return (Node left' right') | |
walktree (NormalLeaf x) = return x |
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 serial | |
from serial.tools import miniterm | |
import subprocess, sys, re, os | |
class ESPMiniterm(miniterm.Miniterm): | |
def handle_menu_key(self, c): | |
if c == '\x15': # ctrl-u | |
self.upload_file() | |
else: | |
super(ESPMiniterm, self).handle_menu_key(c) |
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
/* | |
* Copyright (c) 2015, Majenko Technologies | |
* Copyright (c) 2016, Benjamin Koch | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted provided that the following conditions are met: | |
* | |
* * Redistributions of source code must retain the above copyright notice, this | |
* list of conditions and the following disclaimer. |
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
/indices/ | |
/self-installs/ |
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/sh | |
#cat /proc/acpi/ibm/fan | |
echo "$*" >/proc/acpi/ibm/fan | |
head -n 3 /proc/acpi/ibm/fan | |
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/sh | |
# http://stackoverflow.com/a/1557398 | |
for sha in $(git rev-list --all --pretty=format:"" | sed "s/^commit //") ; do git diff-tree -r -c -M -C --no-commit-id $sha | awk '{print $4}' | git cat-file --batch-check 2>/dev/null | awk '{ sum+=$3 } END {printf "%010d %s\n", sum, "'"$sha"'"}' ; done | sort | tail |
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 <iostream> | |
#include <string> | |
using namespace std; | |
class PrintLifecycle { | |
string name; | |
public: | |
PrintLifecycle(string name) : name(name) { | |
cout << "constructor of " << name << endl; |
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 <iostream> | |
#include <memory> | |
class Foo { | |
std::string name; | |
public: | |
Foo(std::string name) : name(name) { | |
std::cout << "creating " << name << std::endl; | |
} |