Skip to content

Instantly share code, notes, and snippets.

View rigelrozanski's full-sized avatar
🔭
ajsdkajgkjasdlka

frog power 4000 rigelrozanski

🔭
ajsdkajgkjasdlka
View GitHub Profile
@rigelrozanski
rigelrozanski / imgcat.go
Created April 30, 2020 03:55
Iterm2 imgcat image output from golang
import (
"encoding/base64"
"fmt"
"io/ioutil"
"os"
)
func main() {
r, err := os.Open("yourimagehere.png")
if err != nil {
@learntheropes
learntheropes / bittrex_private_and_public_api.gs
Last active March 3, 2021 08:57
Bittrex private and public API for Google Apps Script (Google Sheet)
// work in progress
// you need a bittrex API key and secret with read account option enabled
// I assume that all the keys are in the "keys" spreadsheet. The key is in cell B5 and the secret in cell C5
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("keys");
var key = sheet.getRange("B5").getValue()
var secret = sheet.getRange("C5").getValue();
var baseUrl = 'https://bittrex.com/api/v1.1/';
var nonce = Math.floor(new Date().getTime()/1000);
@learntheropes
learntheropes / poloniex_private_api.gs
Last active June 2, 2019 01:18
Poloniex private API for Google Apps Script (Google Sheet)
// work in progress
// you need a poloniex API key and secret with trading option enabled
// you can test it with:
// = polo("returnBalances","BTC")
// or
// = polo("returnBalances","all")
// or buy and sell:
// polo("BUY","BTC_LTC", 0.0251, 1) or polo("SELL","BTC_LTC", 0.0251, 1)
@mikespook
mikespook / hello.c
Created July 2, 2016 01:40
GIMP Plug-in in Golang
// Comes from http://developer.gimp.org/writing-a-plug-in/1/hello.c
#include <libgimp/gimp.h>
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
@odenak
odenak / private.xml
Last active April 6, 2023 22:40
Karabiner Fn + HJKL / IJKL / WASD / ESDF as arrow keys
<?xml version="1.0"?>
<root>
<item>
<name>F19 to Fn</name>
<appendix>You can use Seil to map CapsLock to F19 (keycode 80)</appendix>
<identifier>private.f19_to_fn</name>
<autogen> __KeyToKey__ KeyCode::F19, KeyCode::FN </autogen>
</item>
<item>
<name>Fn + HJKL as arrows</name>
@mattetti
mattetti / gist:3798173
Last active April 16, 2023 03:09
async fetching of urls using goroutines and channels
package main
import (
"fmt"
"net/http"
"time"
)
var urls = []string{
"https://splice.com/",
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}