Skip to content

Instantly share code, notes, and snippets.

View shockwaves's full-sized avatar

Artem shockwaves

  • black mesa
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<style>
html, body, video {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
"use strict";
class Users {
constructor(id) {
this.id = id;
}
static create(id) {
this.all.push(new this(id));
}
let Table = {
increment: 0,
init(rows,columns){
this.rows = rows;
this.columns = columns;
this.matrix = this.generateMatrix();
},
generateMatrix(){
let arr = [];
for(let i=0; i<this.columns; i++){
(function(Runner) {
var ctx = document.getElementsByTagName('canvas')[0].getContext('2d');
var pixelEnv = ctx.getImageData(1, 1, 1, 1).data;
var distantion = 150;
Runner.instance_.play();
Runner.instance_.tRex.startJump(1);
function getPixelData(x, y) {
return ctx.getImageData(x, y, 1, 1).data;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
#!/bin/bash
# Tumblerdwatcher v 1.0
# Script to check and kill tumblerd process if a loop is suspected. To be automatically scheduled at user session start.
# Homemade workaround for bug: http://forums.linuxmint.com/viewtopic.php?f=110&t=97079&p=767460&hilit=tumblerd#p554241
# The author has no responsibility for the execution. Feel free to distribute and modify it.
# Advice are welcome to [email protected].
period=60 # check period (sec)
process="/usr/lib/i386-linux-gnu/tumbler-1/tumblerd" # tumblerd binary path
Pcpu=20 # tolerated cpu usage (%)
@shockwaves
shockwaves / arduino-serial-io.ino
Last active January 3, 2019 19:36
arduino-serial-io
void setup() {
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
String lolkek = Serial.readString();
lolkek.trim();
@shockwaves
shockwaves / arduino-door-alarm.ino
Created January 4, 2019 20:03
arduino-door-alarm
#define pinDoor 2
#define pinAlarm 3
int doorStatus;
void setup() {
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(pinAlarm, OUTPUT);
pinMode(pinDoor, INPUT_PULLUP);
@shockwaves
shockwaves / arduino-ultrasonic-gates.ino
Last active February 17, 2019 16:04
arduino-ultrasonic-gates.ino
#include <Ultrasonic.h>
#include <Servo.h>
// Pins setup
#define RED_LED 2 // Light stop
#define GREEN_LED 3 // Light allow
#define SERVO_GATE 9 // Gate servo
#define TRIG 12 // Ultrasonic Trig
#define ECHO 13 // Ultrasonic Echo
@shockwaves
shockwaves / arduino-rangefinder.ino
Created February 19, 2019 10:01
arduino-rangefinder.ino
/*
*
* Radar/Rangefinder
*
*/
#include <Ultrasonic.h>
#include "TM1637.h"
#define CLK 3