Skip to content

Instantly share code, notes, and snippets.

@nobleach
nobleach / main.rs
Last active January 23, 2018 03:23
Reverse a string in Rust
extern crate regex;
use regex::Regex;
fn main() {
let sentence = "We're all dorks!";
println!("{}", reverse_string(sentence).to_string());
}
fn reverse_string(string: &str) -> String {
@nobleach
nobleach / beerSong.ml
Created February 12, 2018 02:11
Bottles of Beer
let bottles = function
| 0 -> "no more bottles"
| 1 -> "1 bottle"
| n -> Printf.sprintf "%d bottles" n;;
let rec sing n =
let current = bottles n in
let next = bottles (n-1) in
Printf.printf
"%s of beer on the wall, %s of beer.\n"
@nobleach
nobleach / cloudSettings
Last active June 8, 2022 19:57
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-06-08T13:38:16.825Z","extensionVersion":"v3.2.9"}
-- JDTLS (Java LSP) configuration
local home = vim.env.HOME -- Get the home directory
local jdtls = require("jdtls")
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
local workspace_dir = home .. "/jdtls-workspace/" .. project_name
local system_os = ""
-- Determine OS
{
"basics": {
"name": "Jim Wharton",
"label": "Senior Staff Engineer",
"image": "",
"email": "[email protected]",
"phone": "(385) 319-0105",
"url": "https://github.com/nobleach",
"summary": "A very well principled developer, with fantastic communication skills",
"location": {