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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"time" | |
"github.com/tarm/serial" | |
) |
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
#!/usr/bin/perl | |
use utf8; | |
use 5.010; | |
use strict; | |
#use autodie; | |
use warnings; | |
#use diagnostics; | |
my $who = `whoami`; |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func dump_interface_array(args interface{}) { | |
val := reflect.ValueOf(args) | |
fmt.Println(val.Kind()) |
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
use std::io; | |
mod term { | |
use termios; | |
/// echo off. Return old termios state. | |
pub fn echo_off() -> termios::Termios { | |
let oldstat = termios::Termios::from_fd(0).unwrap(); | |
let mut termstat = oldstat; | |
termstat.c_lflag &= !(termios::ICANON | termios::ECHO); |
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 <memory> | |
#include <iostream> | |
#include <opencv2/core.hpp> | |
#include <opencv2/imgcodecs.hpp> | |
#include <opencv2/highgui.hpp> | |
int main() { | |
std::unique_ptr<uint8_t[]> bufl(new uint8_t[320 * 240]); | |
memset(bufl.get(), 0x00, 320*240/2*sizeof(uint8_t)); | |
memset(bufl.get()+320*240/2, 0x44, 320*240/2*sizeof(uint8_t)); |
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
#!/usr/bin/env bash | |
# This script is to set xrandr as mirroring | |
set -eu | |
DEBUG_ON=0 | |
function log_output() { | |
if [[ $DEBUG_ON -ne 1 || $# -eq 0 ]]; then |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"syscall" | |
) | |
func main() { |
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
#!/usr/bin/env sh | |
# | |
# https://www.kernel.org/doc/Documentation/usb/power-management.txt | |
# | |
set -eu | |
USB_DEVICE_COUNTS=5 |
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
#!/usr/bin/env sh | |
# | |
# https://www.kernel.org/doc/Documentation/usb/power-management.txt | |
# | |
set -eu | |
function fn_help() { |
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
use std::io; | |
#[derive(Debug)] | |
/// tuple-like struct | |
struct Foo(i32); | |
fn num(n: i32) -> io::Result<i32> { | |
Ok(n) | |
} |
NewerOlder