Skip to content

Instantly share code, notes, and snippets.

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

Kalle eioo

👨‍💻
­onpas
  • Finland
View GitHub Profile
{
"React component": {
"prefix": "rcc",
"body": [
"import * as React from 'react';",
"",
"class ${TM_FILENAME_BASE} extends React.Component {",
" public render() {",
" return (",
" <div>",
import * as _ from 'lodash';
interface IAny {
[x: string]: string | number;
}
export default function arrayDiff(oldArray: Array<IAny>, newArray: Array<IAny> ): object {
const additions = _.differenceWith(newArray, oldArray, _.isEqual);
const removals = _.differenceWith(oldArray, newArray, _.isEqual);
return { additions, removals };
@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,
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 / 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
// ==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'];
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'],
@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
@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);
#!/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')