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
class FanCount | |
@queue = "FanCount" | |
include Mongoid::Document | |
field :page_id | |
field :fans | |
field :date | |
index :page_id, :unique => true, :background => true |
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
class FanCount | |
@queue = "FanCount" | |
include Mongoid::Document | |
field :page_id | |
field :fans | |
field :date, :type => DateTime | |
index :page_id, :unique => true, :background => true | |
index( |
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
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 ||= Beard.new | |
@current_user.fetch_info | |
end | |
@current_user.save |
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
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 |
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 <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! |
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 <Arduino.h> | |
#ifdef ESP32 | |
#include <WiFi.h> | |
#include "SPIFFS.h" | |
#else | |
#include <ESP8266WiFi.h> | |
#endif | |
#include "AudioFileSourceSPIFFS.h" | |
#include "AudioGeneratorMP3.h" | |
#include "AudioOutputI2S.h" |
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
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({ |
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
/* | |
Esp8266 Websockets Client | |
This sketch: | |
1. Connects to a WiFi network | |
2. Connects to a Websockets server | |
3. Sends the websockets server a message ("Hello Server") | |
4. Prints all incoming messages while the connection is open | |
Hardware: |
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
import cv2 | |
import asyncio | |
import time | |
# open camera and get video capture object | |
cap = cv2.VideoCapture(0, cv2.CAP_DSHOW) | |
# set camera resolution | |
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280) | |
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720) | |
size=10 | |
cap.set(cv2.CAP_PROP_BUFFERSIZE,size) |
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
import sys | |
import numpy as np | |
import cv2 as cv | |
import NDIlib as ndi | |
import re | |
import asyncio | |
from pythonosc import udp_client | |
from facenet_pytorch import MTCNN | |
from hsemotion.facial_emotions import HSEmotionRecognizer | |
import torch |
OlderNewer