Skip to content

Instantly share code, notes, and snippets.

View kpavlovsky's full-sized avatar
😀

Kostja P kpavlovsky

😀
  • Europe
View GitHub Profile
using UnityEngine;
using System.Collections;
public class menuscript : MonoBehaviour {
public bool menuopen;
public float timeswitched=0f;
public float menufreeze = 0.5f;
public Rect windowRect = new Rect(100, 100, 80, 50);
// Use this for initialization
void Start () {
public start(url: string): void {
console.log("connecting to " + url);
let self = this;
this.url = url;
this.ws = Observable.webSocket(this.url);
this.socket = this.ws.subscribe({
@kpavlovsky
kpavlovsky / utils.py
Last active February 18, 2018 20:39
get certificate expiration time in days, python3.6
from OpenSSL import SSL
import socket
import datetime
import sys
def get_domain_certificate_expiration_days(domain: str, port: int=443) -> int:
cur_date = datetime.datetime.utcnow()
cert_tested = 0
@kpavlovsky
kpavlovsky / setup_emacs.sh
Created February 23, 2018 07:59
Setting up Emacs for Any Programming Language
mv ~/.emacs ~/.emacs_dont_need_this
node@f03e150cb3aa:/code/interface$ npm list
[email protected] /code/interface
+-- UNMET DEPENDENCY [email protected]
+-- UNMET DEPENDENCY @angular-redux/[email protected]
+-- UNMET DEPENDENCY @angular-redux/[email protected]
+-- UNMET DEPENDENCY @angular/[email protected]
| `-- UNMET DEPENDENCY [email protected]
+-- UNMET DEPENDENCY @angular/[email protected]
| `-- UNMET DEPENDENCY [email protected]
+-- UNMET DEPENDENCY @angular/[email protected]
#!/usr/bin/env bash
if [ -z "${STAGE_PRIVATE_KEY}" ]; then echo "STAGE_PRIVATE_KEY is not set"; exit 255; fi
if [ -z "${STAGE_PUBLIC_KEY}" ]; then echo "STAGE_PRIVATE_KEY is not set"; exit 255; fi
pwd
ls
id
mkdir ~/.ssh/
echo -n "$STAGE_PRIVATE_KEY" > ~/.ssh/id_rsa
echo -n "$STAGE_PUBLIC_KEY" > ~/.ssh/id_rsa.pub
@kpavlovsky
kpavlovsky / DokerfileNode
Last active May 22, 2018 21:02
Gitlab CI/CD Runner Scripts with Dockerfile to build Nodejs Angular 5 app in Docker
FROM node:9
USER node
RUN mkdir /home/node/.npm-global
ENV PATH=/home/node/.npm-global/bin:$PATH
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
COPY interface/package.json /home/node/
COPY interface/package-lock.json /home/node/
RUN npm i -g [email protected]
RUN npm i -g @angular/[email protected]
WORKDIR /home/node
bool checkSeesEnemy(){
int layerMask = 1 << 8;
RaycastHit hit;
if (Physics.Raycast(transform.position, transform.TransformDirection (Vector3.forward), out hit, see_distance, layerMask)) {
Debug.DrawRay(transform.position, transform.TransformDirection (Vector3.forward) * hit.distance, Color.yellow);
Debug.Log("Did Hit");
return true;
} else {
Debug.DrawRay(transform.position, transform.TransformDirection (Vector3.forward) *1000, Color.white);
Debug.Log("Did not Hit");
@kpavlovsky
kpavlovsky / droplet_creation.py
Created October 28, 2019 10:56
Create a Digital Ocean Droplet with Ubuntu 18.04 via Python 3 API
manager = digitalocean.Manager(token=user.digital_ocean_token)
images = manager.get_global_images()
image_id = None
for i in images:
if i.slug == 'ubuntu-18-04-x64':
image_id = i.id
if not image_id:
return "Server creation failed, could not find a suitable image"
droplet = digitalocean.Droplet(
token=user.digital_ocean_token,