Skip to content

Instantly share code, notes, and snippets.

View selfup's full-sized avatar
💻
doing the most

Regis Boudinot selfup

💻
doing the most
View GitHub Profile
package main
import (
"fmt"
"math/rand"
"strings"
"sync"
)
func main() {
@selfup
selfup / parseCSVIntoArrayOfObjects.js
Created September 16, 2018 02:08
CSV String to Array of Objects
const fileString = "title,body\nhello,wow\nwow,ok";
const csv = fileString.split('\n');
console.log(csv);
const headers = csv[0].split(',');
const rows = csv.splice(1);
package main
import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"strings"
"sync"
)
#!/usr/bin/env bash
set -ex
sudo apt update
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.1
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
package main
import (
"encoding/hex"
"log"
"strconv"
"strings"
"github.com/jacobsa/go-serial/serial"
)
package main
import (
"errors"
"fmt"
)
func main() {
first := []int{1, 2, 3}
second := []int{4, 5, 6}
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Id Type Time Length Hex Ascii
22 Out (USB URB Function: 9) 0.000000 20 00 00 00 00 00 00 04 c4 00 00 00 00 00 00 00 00 00 00 00 00 ....................
22 In (USB URB Function: 9) 0.002572 8 39 01 00 00 a5 0b 0d 0f 9.......
22 Out (USB URB Function: 9) 1.993371 20 01 00 00 00 00 00 04 c4 00 00 00 00 00 00 00 00 00 00 00 00 ....................
22 In (USB URB Function: 9) 0.002627 8 39 01 01 00 a5 0b 0d 0f 9.......
22 Out (USB URB Function: 9) 0.003938 20 02 00 00 00 00 00 04 c4 00 00 00 00 00 00 00 00 00 00 00 00 ....................
22 In (USB URB Function: 9) 0.003093 8 39 01 02 00 a5 0b 0d 0f 9.......
22 Out (USB URB Function: 9) 1.677804 20 03 00 00 00 00 00 04 c4 00 00 00 00 00 00 00 00 00 00 00 00 ....................
22 In (USB URB Function: 9) 0.003166 8 39 01 03 00 a5 0b 0d 0f 9.......
22 Out (USB URB Function: 9) 0.002329 20 04 00 00 00 00 00 04 b3 00 00 00 00 00 00 00 00 00 00 00 00 ....................
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Id Type Time Length Hex Ascii
22 Out (USB URB Function: 9) 0.000000 20 2d 00 00 00 00 00 04 fc 00 00 00 00 00 00 00 00 00 00 00 00 -...................
22 Out (USB URB Function: 9) 0.001021 20 2e 00 00 00 00 00 04 ec 00 00 00 00 00 00 00 00 00 00 00 00 ....................
22 In (USB URB Function: 9) 1.758670 0
package main
import (
"fmt"
"net/http"
"github.com/selfup/horde"
)
func main() {