Skip to content

Instantly share code, notes, and snippets.

View Psidium's full-sized avatar

Gabriel Borges Psidium

  • Concur
  • Bellevue, WA
View GitHub Profile
@Psidium
Psidium / history.ts
Created July 22, 2022 13:35
Using Deno to gather Statistics about the Zsh history file
import _ from 'https://deno.land/x/lodash@4.17.15-es/lodash.js';
const file = await Deno.readTextFile("/Users/psidium/.zsh_history");
const iterator = file.matchAll(/:\s*(\d*):0;/g);
const dates: Date[] = [];
for (const [, timestamp] of iterator) {
dates.push(new Date(1000*Number(timestamp)));
}
@Psidium
Psidium / track.py
Last active September 6, 2015 01:32 — forked from anonymous/track.py
import cv2, math
import numpy as np
class ColourTracker:
def __init__(self):
#this creates the window you'll use to show the data
cv2.namedWindow("ColourTrackerWindow", cv2.CV_WINDOW_AUTOSIZE)
self.capture = cv2.VideoCapture(0)
self.capture.set(3,320)
self.capture.set(4,280)
#this sets a scale to down the data (i.e. set to 2 to process a image half the original size)
@Psidium
Psidium / UIImageFromBundle.swift
Created April 23, 2015 17:11
UIImage from Bundle
//
//
// Created by Psidium on 4/23/15.
// MIT License.
//
// I've created this initializer to load an UIImage from a NSBundle, a XCTest for example
// but I didn't know Apple had implemented this as UIImage(fromBundle: ... )
//
import UIKit