Skip to content

Instantly share code, notes, and snippets.

View detect.js
const tf = require('@tensorflow/tfjs-node-gpu');
const cv = require("@u4/opencv4nodejs");
const posenet = require("@tensorflow-models/posenet")
let camera = new cv.VideoCapture(0);
camera.set(cv.CAP_PROP_FRAME_WIDTH, 640);
camera.set(cv.CAP_PROP_FRAME_HEIGHT, 480);
async function loadPosenet() {
net = await posenet.load({
View gist:975253eeef7c1a3beada97bf38223fc2
#include <Arduino.h>
#ifdef ESP32
#include <WiFi.h>
#include "SPIFFS.h"
#include <ESP8266WiFi.h>
#include "AudioFileSourceSPIFFS.h"
#include "AudioGeneratorMP3.h"
#include "AudioOutputI2S.h"
View wpa2-enterprise-esp8266.ino
#include <ESP8266WiFi.h>
#include <ArduinoWebsockets.h>
// include wpa2 enterprise code
extern "C" {
#include "user_interface.h"
#include "wpa2_enterprise.h"
// SSID, Username and password. Update with yours!
venetanji / gist:3937545
Created October 23, 2012 08:03
Syncable class
View gist:3937545
class Syncable
include Mongoid::Document
field :url
field :method, default: :get
field :query
field :body
field :headers, default: {}
field :callback_class, default: :syncable
field :callback_method, default: :default
View gist:1113624
def set_current_user
if @signed_request
if @signed_request['user_id']
@current_user = User.find_or_initialize_by(id: @signed_request['user_id'])
@current_user.token = @signed_request['oauth_token']
if @current_user.new_record?
@current_user.beard ||=
View gist:554911
class FanCount
@queue = "FanCount"
include Mongoid::Document
field :page_id
field :fans
field :date, :type => DateTime
index :page_id, :unique => true, :background => true
View gist:553299
class FanCount
@queue = "FanCount"
include Mongoid::Document
field :page_id
field :fans
field :date
index :page_id, :unique => true, :background => true