Skip to content

Instantly share code, notes, and snippets.

View eioo's full-sized avatar
👨‍💻
­onpas

Kalle eioo

👨‍💻
­onpas
  • Finland
View GitHub Profile
@eioo
eioo / app.js
Last active January 25, 2018 14:47
Gulp + Express + Nodemon + Browser-sync in harmony
const express = require('express');
const app = express();
const router = express.Router();
app.use(express.static('public'));
app.listen(3000);
function angleCalculator(enemyPos : IPos, myPos : IPos) : IAngle {
const deltaX = myPos.x - enemyPos.x;
const deltaY = myPos.y - enemyPos.y;
const deltaZ = myPos.z - enemyPos.z;
const pitch = Math.atan2( deltaY, deltaZ );
let yaw;
if (deltaZ >= 0) {
yaw = -Math.atan2(deltaX * Math.cos(pitch), deltaZ);
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import requests
import urllib2
from distutils.version import LooseVersion
def urldecode(s):
return urllib2.unquote(s).decode('utf8')
@eioo
eioo / Form.tsx
Last active March 26, 2018 13:10
import * as React from 'react';
interface FormState {
name: string;
message: string;
}
class Form extends React.Component<{}, FormState> {
constructor(props: {}) {
super(props);
@eioo
eioo / test.ts
Last active April 9, 2018 18:48
import * as _ from 'lodash';
const jokuArray = [1,2,3,4,5];
function sleep(ms) {
return new Promise(res => setTimeout(res, ms));
}
async function main() {
// await wörkkii
import * as robot from 'robotjs';
import * as winctl from 'winctl';
import * as _ from 'lodash';
const typingSpeed = 350; // Chars in minute
const solutions = [
['play', 'pull door', 'remove pants', 'enter toilet', 'shit'],
['play', 'remove pants', 'shit'],
['play', 'shit'],
['play', 'pull door', 'enter toilet', 'shit'],
// ==UserScript==
// @name OSRS Hiscores fix
// @namespace http://google.com
// @description Fixes OSRS hiscores layout
// @include http://services.runescape.com/m=hiscore_oldschool*/*
// @version 1.0
// @grant none
// ==/UserScript==
const categoryOrder = ['Clue Scrolls (all)', 'Bounty Hunter - Rogue', 'Bounty Hunter - Hunter', 'LMS - Rank'];
@eioo
eioo / sm3.lua
Last active April 10, 2018 20:39
function read_file (filename)
input = io.open(filename, "r") -- Open this file with the read flag.
if input ~= nil then
io.input(input) -- Set the input that the io library will read from.
input_content = io.read() -- Read the contents of the file.
io.close(input) -- Close the file.
end
return input_content
end
function loadNewReplies(t) {
if (updateRunning) return !1;
if ($("#msg").is(":focus")) return autoupdate && (nextReplyUpdateTimeout = setTimeout(function () {
loadNewReplies(t)
}, 2e3)), !1;
var e = $$(t).find(".answers .answer:last");
if (e.is("*")) var s = e.attr("id").replace("no", "");
else var s = 1;
if (0 == t.length || 0 == s.length) return !1;
updateRunning = !0, $.get(siteUrl + "/scripts/ajax/get_new_replies.php", {
@eioo
eioo / tsconfig.json
Last active April 21, 2018 13:53
tsconfig template
{
"compilerOptions": {
"outDir": "./build",
"module": "commonjs",
"target": "es6",
"lib": ["es6"],
"sourceMap": true,
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,