Skip to content

Instantly share code, notes, and snippets.

View xyzshantaram's full-sized avatar

Siddharth Singh xyzshantaram

View GitHub Profile
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package siddharth;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package FileSearch;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
#include <ESP8266WiFi.h>
const char* ssid = "Ranjit";
const char* password = "avantika98";
const char* host = "IP OF THE ESP8266"; //it will tell you the IP once it starts up
//just write it here afterwards and upload
int ledPin = D3;
WiFiServer server(80); //just pick any port number you like
/*
I'm abusing four shift registers [in chains of two each] to get 32 inputs
*/
#define NUMREGS 1
#define PINSPERCHAIN 8 // used to write all 1's in loop()
const int interrupt[NUMREGS] = {2}; // the two interrupt pins on the arduino uno
const int latch[NUMREGS] = {5}; // the latch pins for our shiftreg chains
@xyzshantaram
xyzshantaram / HighestCPUTemp
Last active January 3, 2019 17:17
i3 config files
echo $(sensors | awk '{print $4}' | tr -d '\n' | cut -b 2-5)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SLS Draft</title>
<style title="Twine CSS">@-webkit-keyframes appear{0%{opacity:0}to{opacity:1}}@keyframes appear{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fade-in-out{0%,to{opacity:0}50%{opacity:1}}@keyframes fade-in-out{0%,to{opacity:0}50%{opacity:1}}@-webkit-keyframes rumble{50%{-webkit-transform:translateY(-0.2em);transform:translateY(-0.2em)}}@keyframes rumble{50%{-webkit-transform:translateY(-0.2em);transform:translateY(-0.2em)}}@-webkit-keyframes shudder{50%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}@keyframes shudder{50%{-webkit-transform:translateX(0.2em);transform:translateX(0.2em)}}@-webkit-keyframes box-flash{0%{background-color:white;color:white}}@keyframes box-flash{0%{background-color:white;color:white}}@-webkit-keyframes pulse{0%{-webkit-transform:scale(0, 0);transform:scale(0, 0)}20%{-webkit-transform:scale(1.2, 1.2);transform:scale(1.2, 1.2)}40%{-webkit-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}6
Trace file has been created: TraceLog20190426123204.txt
Mod Manager Version: 0.65.2.0
OS version: Microsoft Windows NT 6.1.7601 Service Pack 1
Installed .NET Versions:
CDF SP 0
v1.1.4322 SP 1
v2.0.50727 SP 2
v3.0 SP 2
v4 SP 0
v4.0 SP 0
public class Constants {
public static final int tileSize = 32;
public static final int framerate = 30;
public static final String bgColor = "007CDF";
public static final String defaultEnemyClr = "FF0000";
public static final String defaultPlayerClr = "00FF00";
}
function hexToRgb(hex) {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
return r + r + g + g + b + b;
});
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
class Camera {
constructor (x, y, player) {
// x and y are top-left coordinates of the camera rectangle relative to the map.
// This rectangle is exctaly cvs.width px wide and cvs.height px tall.
this.pos = new Vector2(x, y);
this.follow = player;
}
focus (cvs, player) {
this.pos = player.pos.sMul(-1).add(new Vector2(canvas.width/2, canvas.height/2));