Skip to content

Instantly share code, notes, and snippets.

View wbthomason's full-sized avatar
💭
On the job market!

Wil Thomason wbthomason

💭
On the job market!
View GitHub Profile
@wbthomason
wbthomason / gist:6705396
Created September 25, 2013 20:15
A partial module for internal shell functions.
use std::{os, path, str};
mod internal {
pub fn changedir(pathstr: &str) {
let path = Path(pathstr);
if os::path_exists(path) && os::path_is_dir(path) && os::change_dir(path){
println(pathstr);
}
else {
println(fmt!("Error: %s is not a valid directory", pathstr));
println(fmt!("Current working directory is: %s", str::str(os::getcwd())));
@wbthomason
wbthomason / Fixed Signals
Created February 7, 2014 07:19
A fixed version of some example Rust code showing simple signal handling.
use std::io::signal::{Listener, Interrupt};
fn main() {
let mut listener = Listener::new();
listener.register(Interrupt);
let listener = listener;
do spawn {
loop {
match listener.port.recv() {
@wbthomason
wbthomason / UVa: CS Courses and Programming Languages.md
Last active July 21, 2022 00:37
UVa: CS Courses and Programming Languages

This is only my personal opinion, and other TAs probably will differ/should also post their opinions.

Java and C++ are really very similar. Java is more strictly object oriented than C++, and C++ lets the programmer have more low-level control (or rope with which to hang themselves, depending on how you look at it), but the paradigms they enforce are largely the same. So, when considering a new language to learn, we really have to consider what we'll get out of it - what about the language makes it worth learning. There are a few factors here. First, as the student answers have mentioned, the practicality of a language is important. If knowing a language might be necessary to get you a good job or to allow you to contribute meaningfully to a large open-source project, it might be a good idea to learn it. Second, you also need to look at how the language can help you in a larger sense. Does it use a unique paradigm, or one you haven't encountered before? Can it introduce you to new ways of thinking about and

Keybase proof

I hereby claim:

  • I am wbthomason on github.
  • I am wbthomason (https://keybase.io/wbthomason) on keybase.
  • I have a public key ASBXIldLEwPq1L_TU1NDUJX695XwcHOjMI4viUgp8CYlAAo

To claim this, I am signing this object:

@wbthomason
wbthomason / minrc.vim
Created September 20, 2018 16:27
Minimum vimrc for LCN issue
call plug#begin('~/.local/share/nvim/plugs')
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
call plug#end()
" Always draw sign column. Prevent buffer moving when adding/deleting sign.
@wbthomason
wbthomason / help.vim
Last active December 26, 2023 01:41
Neovim: Open help in a floating window
scriptencoding utf-8
" This function originates from https://www.reddit.com/r/neovim/comments/eq1xpt/how_open_help_in_floating_windows/; it isn't mine
function! CreateCenteredFloatingWindow() abort
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
@wbthomason
wbthomason / PKGBUILD
Last active April 30, 2020 13:37
Working lua-language-server-git PKGBUILD
# Contributor: Mohammad AlSaleh <CE.Mohammad.AlSaleh at gmail dot com>
# Updated by: Wil Thomason <wbthomason@cs.cornell.edu>
_pkgname="lua-language-server"
pkgname="$_pkgname-git"
pkgver=r2372.ad3baf56
pkgrel=1
license=('MIT')
pkgdesc='Lua Language Server coded by Lua'
url='https://github.com/sumneko/lua-language-server'
@wbthomason
wbthomason / gen_vimdoc.py
Created July 6, 2020 16:22
Docs generation files for lsp-status.nvim (modified from core Neovim files)
#!/usr/bin/env python3
"""Generates Nvim :help docs from C/Lua docstrings, using Doxygen.
Flow:
main
extract_from_xml
fmt_node_as_vimhelp \
para_as_map } recursive
update_params_map /
render_node