Skip to content

Instantly share code, notes, and snippets.

@jimmychu0807
jimmychu0807 / string-conversion.rs
Created Nov 21, 2019
Conversion between String, str, Vec<u8>, Vec<char> in Rust
View string-conversion.rs
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@badsyntax
badsyntax / INSTRUCTIONS.md
Last active Mar 24, 2020
Getting started with Java development on macOS
View INSTRUCTIONS.md

Getting started with Java development on macOS

Install multiple Java versions

To start, list current installed Java versions:

/usr/libexec/java_home -verbose
View introduction-to-parser-combinators.md

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps

  1. what is a parser?
  2. and.. what is a parser combinator?

So first question: What is parser?

View Nginx reverse proxy aws s3 resources.
proxy_cache_path /var/nginx/cache/aws/trueniu levels=2:2:2 use_temp_path=off keys_zone=aws_3:500m inactive=30d max_size=10g;
server {
listen 80;
server_name trueniu.com www.trueniu.com;
if ( $scheme = http ) {
return 301 https://www.trueniu.com$request_uri;
}
}
@arielzn
arielzn / ssh_run.py
Last active Dec 12, 2017
Running commands with paramiko on remote hosts defined on ssh_config
View ssh_run.py
#!/usr/bin/env python
import os
import paramiko
import argparse
import socket
import logging
def create_ssh_client(hostname):
@matejb
matejb / pipe_executor.go
Created Aug 10, 2017
simple Go pipe executor
View pipe_executor.go
package main
import (
"bytes"
"fmt"
"log"
"os/exec"
"strings"
)
@wassname
wassname / geojson2shapely.ipynb
Last active May 6, 2018
Convert any geojson to shapely
View geojson2shapely.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active Nov 23, 2020
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
View understanding-word-vectors.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active Nov 19, 2020
Running Windows 10 on AWS EC2
View Windows10AWSEC2.md

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

You can’t perform that action at this time.