Skip to content

Instantly share code, notes, and snippets.

View codemodify's full-sized avatar
🌴
On vacation

codemodify

🌴
On vacation
  • Planet Earth
View GitHub Profile
@codemodify
codemodify / install.sh
Last active December 28, 2018 08:59
Arch Linux - ThinkPad T580
# System
echo en_US.UTF-8 >> /etc/locale.gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
echo KEYMAP=us > /etc/vconsole.conf
rm /etc/localtime
ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime
hwclock --systohc --utc
echo arch-box /etc/hostname
@codemodify
codemodify / qosmicparticles-io-samples.sh
Last active January 17, 2019 11:35
qosmicparticles-io-samples.sh
curl qosmicparticles.io:4444/FetchGobs \
-H "Content-Type: application/json" \
-X POST -d '{"version": "2.0", "key": "rcd1JN+CkZo2+KKR802bXTujubMbiZARQcyTR8Ku8haqdyaz8pA8Z1kbrWJO2J2CiwFdnr", "gobSize": 100}'
@codemodify
codemodify / qosmicparticles-io-samples.go
Last active January 17, 2019 11:34
qosmicparticles-io-samples.go
package main
import (
"fmt"
"bytes"
"io/ioutil"
"net/http"
)
@codemodify
codemodify / qosmicparticles-io-samples.js
Last active January 17, 2019 12:09
qosmicparticles-io-samples.js
// ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~
// XHR Example
// ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~
var data = JSON.stringify({
"version": "2.0",
"key": "rcd1JN+CkZo2+KKR802bXTujubMbiZARQcyTR8Ku8haqdyaz8pA8Z1kbrWJO2J2CiwFdnr",
"gobSize": 10
});
@codemodify
codemodify / qosmicparticles-io-samples.java
Last active January 17, 2019 11:34
qosmicparticles-io-samples.java
package test;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
@codemodify
codemodify / qosmicparticles-io-samples.py
Last active January 17, 2019 11:34
qosmicparticles-io-samples.py
import requests
r = requests.post("http://qosmicparticles.io:4444/FetchGobs", data={
"version": "2.0",
"key": "rcd1JN+CkZo2+KKR802bXTujubMbiZARQcyTR8Ku8haqdyaz8pA8Z1kbrWJO2J2CiwFdnr",
"gobSize": 96
})
print(r.status_code, r.reason)
@codemodify
codemodify / qosmicparticles-io-samples.http
Last active January 17, 2019 12:14
qosmicparticles-io-samples.http
POST /FetchGobs HTTP/1.1\r\n
Host: qosmicparticles.io:4444\r\n
Content-Type: application/json\r\n
Content-Length: 113\r\n\r\n
{"version": "2.0", "key": "rcd1JN+CkZo2+KKR802bXTujubMbiZARQcyTR8Ku8haqdyaz8pA8Z1kbrWJO2J2CiwFdnr", "gobSize": 8}
@codemodify
codemodify / qosmicparticles-io-samples.c
Last active January 17, 2019 12:12
qosmicparticles-io-samples.c
// ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~
// libcurl Example
// ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "http://qosmicparticles.io:4444/FetchGobs");
struct curl_slist *headers = NULL;
@codemodify
codemodify / qosmicparticles-io-samples-node.js
Last active January 17, 2019 11:45
qosmicparticles-io-samples-node.js
var http = require("http");
var options = {
"method": "POST",
"hostname": [
"qosmicparticles.io"
],
"port": "4444",
"path": [
@codemodify
codemodify / qosmicparticles-io-samples.cs
Created January 17, 2019 11:49
qosmicparticles-io-samples.cs
var client = new RestClient("http://qosmicparticles.io:4444/FetchGobs");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n \"version\": \"2.0\",\n \"key\": \"rcd1JN+CkZo2+KKR802bXTujubMbiZARQcyTR8Ku8haqdyaz8pA8Z1kbrWJO2J2CiwFdnr\",\n \"gobSize\": 10\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);