Skip to content

Instantly share code, notes, and snippets.

View telday's full-sized avatar

Ellis Wright telday

View GitHub Profile
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final TextView text = (TextView)findViewById(R.id.helloText);
final Button button = (Button)findViewById(R.id.helloButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
text.setText("Hello World!");
}
final TextView text = (TextView)findViewById(R.id.helloText);
final Button button = (Button)findViewById(R.id.helloButton);
@telday
telday / define_example.c
Last active October 10, 2018 21:23
#define example
#include <stdio.h>
#define MAIN int main(){puts("Hello World");return 0;}
MAIN
#define TEST_STRING "Hello World!"
char* test_string = TEST_STRING;
#define NAME VALUE
const variable_type NAME VALUE;
@telday
telday / factorio-recipe-parser.lua
Created February 3, 2020 23:40 — forked from pfmoore/factorio-recipe-parser.lua
Parse the Factorio recipe files to create a CSV of recipes
data = {}
data["extend"] = function (data, t)
for n, recipe in ipairs(t) do
for i, component in ipairs(recipe["ingredients"]) do
cname = component[1] or component["name"]
camt = component[2] or component["amount"]
print('"' .. recipe["name"] .. '","' .. cname .. '",' .. camt)
end
end
end
colorscheme desert
let mapleader="."
nnoremap . <nop>
nnoremap <leader>rc :vsplit $MYVIMRC<cr>
nnoremap <leader>" /(<cr>Na"<esc>/)<cr>s")<esc>
set shortmess=at
set cmdheight=1
inoremap kl <esc>
nnoremap t V>
nnoremap T V<
"""
Example of using py_cui to create a simple Command line TODO list in under 150 lines of code
@author: Jakub Wlodek, Ellis Wright (telday)
@created: 12-Aug-2019
"""
import py_cui
import os
@telday
telday / vdoc.bat
Created March 13, 2020 16:32
Windows command for viewing python docs in vim
echo off
if "%1" == "" GOTO fail
python -m pydoc %1 > %1.txt
vim %1.txt
rm %1.txt
goto end
:fail
echo This program requires the name of a module as the argument
:end
@telday
telday / conf.py
Created April 17, 2020 21:00
Read The Docs Theme ugly boxes fix
html_static_path = ['_static']
html_css_files = ['no_boxes.css']