Skip to content

Instantly share code, notes, and snippets.

View voldyman's full-sized avatar

Akshay Shekher voldyman

View GitHub Profile
@voldyman
voldyman / main.go
Created March 28, 2020 18:01
TUI for searcher
package main
import (
"fmt"
"log"
"github.com/marcusolsson/tui-go"
)
func main() {
diff --git a/sshd/net.go b/sshd/net.go
index 8305696..154ec45 100644
--- a/sshd/net.go
+++ b/sshd/net.go
@@ -2,6 +2,7 @@ package sshd
import (
"net"
+ "time"
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/timerfd.h>
typedef struct TimeEvent {
int fd;
char* message;
struct timespec added_time;
╭─voldyman@arc.local ~/dev/nothing ‹master*›
╰─➤ scc .
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Code Comments Blanks Complexity
───────────────────────────────────────────────────────────────────────────────
C Header 67 2334 1738 23 573 44
C 65 11394 9278 77 2039 1292
Lisp 8 30 24 0 6 0
Plain Text 5 140 132 0 8 0
Markdown 5 264 194 0 70 0
@voldyman
voldyman / healthkit-data-to-csv.go
Created April 26, 2019 03:29
This program takes the XML file from iPhone's Health app (Health -> User -> Export data) and converts it into a CSV file with max, min, avg, p75 & p90 heart rate.
package main
import (
"encoding/csv"
"encoding/xml"
"flag"
"fmt"
"io/ioutil"
"os"
"sort"
use std::io;
use std::env;
use std::fs::{self, DirEntry};
use std::path::Path;
fn visit_dirs(dir: &Path, cb: &Fn(&DirEntry)) -> io::Result<()> {
if dir.is_dir() {
for entry in fs::read_dir(dir)? {
let entry = entry?;
let path = entry.path();
#include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdbool.h>
static
bool startswith(const char* str, const char* prefix) {
if ((str == NULL) || (prefix == NULL)) {
╭─voldyman@arc.local ~/dev/nothing ‹master*›
╰─➤ cloc . 2 ↵
167 text files.
161 unique files.
22 files ignored.
github.com/AlDanial/cloc v 1.80 T=0.37 s (392.4 files/s, 38714.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
#include <stdio.h>
#include <stdarg.h>
#define DEBUG
#ifdef DEBUG
#define DEBUG_MSG(fmt, ...) print_debug(fmt, ##__VA_ARGS__)
#else
#define DEBUG_MSG(fmt, args...) ((void) 0)
#endif
[package]
name = "first"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
[dependencies]
serde = "1.0.81"
serde_json = "1.0.33"
serde_derive = "1.0.81"