Skip to content

Instantly share code, notes, and snippets.

View the-shank's full-sized avatar
💭
#rust #llvm

theshank the-shank

💭
#rust #llvm
View GitHub Profile
@the-shank
the-shank / tzdata.log
Created July 22, 2023 05:35
voidlinux tzdata update logs
[shank@tryvoid ~]$ sudo xbps-install --repository -u tzdata --verbose
Found tzdata-2023a_2 in repository https://repo-default.voidlinux.org/current
Name Action Version New version Download size
tzdata update 2022g_1 2023a_2 -
Size required on disk: 1167KB
Space available on disk: 102GB
Do you want to continue? [Y/n]
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \
@the-shank
the-shank / playground.rs
Created August 12, 2019 06:50 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::cell::RefCell;
use std::rc::Rc;
#[derive(Debug, Clone)]
struct Node {
value: String,
next: Link,
prev: Link,
}
@the-shank
the-shank / singly_linked_list.rs
Last active August 9, 2019 05:03 — forked from rust-play/playground.rs
DS - Rust - Singly Linked List
use std::cell::RefCell;
use std::rc::Rc;
#[derive(Clone)]
struct Node {
value: String,
next: SingleLink,
}
impl Node {
@the-shank
the-shank / shared.rs
Created August 2, 2019 09:43 — forked from stevedonovan/shared.rs
An ergonomic way of saying Rc<RefCell>
use std::rc::Rc;
use std::cell::{RefCell,Ref, RefMut};
use std::ops::Deref;
use std::fmt;
#[derive(Clone)]
struct Shared<T> {
v: Rc<RefCell<T>>
}
@the-shank
the-shank / router.ex
Created September 2, 2017 08:00 — forked from aportnov/router.ex
Elixir: Compiled EEx templates in Plug application
defmodule MyModule.Router do
@moduledoc """
Http Entry Point
"""
use Plug.Router
use Plug.ErrorHandler
plug Plug.Logger
plug :match
@the-shank
the-shank / example1.java
Last active September 3, 2015 09:17
Managing Servlet JSON Response
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
List<String> list = new ArrayList<String>();
list.add("item1");
list.add("item2");
list.add("item3");
String json = new Gson().toJson(list);
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.contrib import files
USAGE = """
================================================================
NOTE:
using this fabfile expects that you have the python utility