Skip to content

Instantly share code, notes, and snippets.

@anttti
anttti / bots.md
Last active February 16, 2017 08:16
looby-bots-guide
@anttti
anttti / looby-bot-2.js
Last active February 15, 2017 17:11
looby-bot-2
const TelegramBot = require('node-telegram-bot-api');
const token = 'token-goes-here';
const bot = new TelegramBot(token, { polling: true });
bot.on('message', (message) => {
console.log(message);
bot.sendMessage(message.chat.id, 'Received your message');
});
@anttti
anttti / looby-bot-1.js
Last active November 15, 2020 17:56
looby-bot-1
const TelegramBot = require('node-telegram-bot-api');
const token = 'token-goes-here';
const bot = new TelegramBot(token, { polling: true });
bot.onText(/\/hai/, (message) => {
bot.sendMessage(message.chat.id, 'hello looby');
});
console.log('I am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do.');
@anttti
anttti / autoexec.cfg
Last active August 1, 2019 15:53
CS: GO binds
bind f "use weapon_flashbang"
bind c "use weapon_smokegrenade"
bind g "use weapon_hegrenade"
bind x "use weapon_incgrenade;use weapon_molotov"
bind "kp_ins" "buy vesthelm;"
bind "kp_del" "buy ak47; buy m4a1;"
bind "kp_enter" "buy flashbang;"
bind "kp_plus" "buy smokegrenade;"
bind "kp_minus" "buy sg556; buy aug;"
@anttti
anttti / lego-space.csv
Created December 7, 2016 06:41
Lego Space Kit Names
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
SetID,Number,Variant,Theme,Subtheme,Year,Name,Minifigs,Pieces,UKPrice,USPrice,CAPrice,EUPrice,ImageURL
7522,"0012","1","Space","","1979","Space minifigures",2,4,,,,,"http://images.brickset.com/sets/images/0012-1.jpg"
7523,"0013","1","Space","","1979","Space minifigures",2,4,,,,,"http://images.brickset.com/sets/images/0013-1.jpg"
7524,"0014","1","Space","","1979","Space minifigures",2,4,,,,,"http://images.brickset.com/sets/images/0014-1.jpg"
7563,"0015","1","Space","","1979","Space Mini-Figures",3,18,,,,,"http://images.brickset.com/sets/images/0015-1.jpg"
9581,"54","1","Space","UFO","1997","UFO Action Pack",,96,,,,,"http://images.brickset.com/sets/images/54-1.jpg"
1273,"305","1","Space","Classic","1979","Two Crater Plates",,2,,,,,"http://images.brickset.com/sets/images/305-1.jpg"
1284,"306","1","Space","Classic","1979","Two Lunar Landing Plates",,2,,,,,"http://images.brickset.com/sets/images/306-1.jpg"
2104,"442","1","Space","Classic","1979","Space Shuttle",1,39,,,,,"http://images.brickset.com/sets/images/442-
@anttti
anttti / Dockerfile
Created October 26, 2016 14:52
WP-Docker
FROM wordpress
MAINTAINER Antti Mattila <me@rarelyneeded.com>
COPY ./wp-content /var/www/html/wp-content
@anttti
anttti / customkeys.json
Created October 4, 2016 05:49
My VS Code Custom Keybindings
[
{ "key": "cmd+shift+d", "command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus" },
{ "key": "cmd+alt+w", "command": "editor.action.toggleWordWrap",
"when": "editorTextFocus" },
{ "key": "cmd+shift-c", "command": "editor.action.commentLine",
"when": "editorTextFocus" },
{ "key": "shift+ctrl+down", "command": "cursorColumnSelectDown",
"when": "editorTextFocus" },
{ "key": "shift+ctrl+up", "command": "cursorColumnSelectUp",
$(function() {
$("#axios").on("click", function() {
axios.post("http://wordpress.dev/wp-json/wp/v2/movie", {
title: $("#title").val(),
status: "publish"
}, {
headers: {
"Authorization": "Basic YWRtaW46YWRtaW4="
}
}).then(function(res) {
@anttti
anttti / react-test.js
Created November 5, 2015 19:32
Testing React 0.14 components
import React from "react";
import ReactTestUtils from "react-addons-test-utils";
const { renderIntoDocument, scryRenderedDOMComponentsWithTag } = ReactTestUtils;
import { expect } from "chai";
const Test = React.createClass({
render() {
return (
<div>
<span>Foo</span>
@anttti
anttti / api.md
Last active November 4, 2015 19:08
RaceTime API draft

RaceTime API

All URLs prefixed with /v1

GET /track/

Retrieve all tracks.

{