Skip to content

Instantly share code, notes, and snippets.

View trickster's full-sized avatar
🎯
Focusing

Sivaram Konanki trickster

🎯
Focusing
  • Tokyo
  • 23:37 (UTC +09:00)
View GitHub Profile
@trickster
trickster / async.md
Last active February 9, 2022 02:11
Using both Tokio and async-std together

Option 1 using async-compat

// async-compat = "0.2.1"
// async-std = {version = "1.10.0"}
// tokio = { version = "1", features = ["full"] }
use async_compat::Compat;

async fn say_hello() {
 println!("Hello, world!");
@trickster
trickster / deps.edn
Created August 15, 2021 12:01 — forked from athos/deps.edn
Try `clojure -Sdeps '{:deps {hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :sha "1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9"}}}' -m hello-clojure` on your terminal
{:paths ["."]
:deps {clansi {:mvn/version "1.0.0"}}}
use std::{
fs::File,
io::{Read, Write},
time::Instant,
};
use tokio::task::{self, JoinHandle};
async fn compute() {
let handles: Vec<JoinHandle<_>> = (0..1000)
.map(|_| {
console.log('This is awesome')
@trickster
trickster / .gitignore
Created April 16, 2020 03:02 — forked from tvwerkhoven/.gitignore
XeTeX cheatsheet
*.aux
*.log
*.out
*.pdf
*.synctex.gz*
All messages from `brew upgrade`
By default, binaries installed by gem will be placed into:
/usr/local/lib/ruby/gems/2.6.0/bin
You may want to add this to your PATH.
ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
@trickster
trickster / sftp_listdir.go
Created August 1, 2019 01:44
Lists the contents of a directory on SFTP server
// List dir contents
package main
import (
"fmt"
"log"
"net"
"os"
"golang.org/x/crypto/ssh"
[diouser@ins-atrvdiobatch101z konankisivar01]$ python simple_sftp_test.py
Hostkey for partnerupload.google.com doesn't exist
Traceback (most recent call last):
File "simple_sftp_test.py", line 30, in <module>
list_dir()
File "simple_sftp_test.py", line 17, in list_dir
with pysftp.Connection(host, port = port, username = username, password = password, cnopts = cnopts) as sftp:
File "/home/diouser/.local/lib/python2.7/site-packages/pysftp/__init__.py", line 140, in __init__
self._start_transport(host, port)
File "/home/diouser/.local/lib/python2.7/site-packages/pysftp/__init__.py", line 176, in _start_transport
@trickster
trickster / git-pushing-multiple.rst
Created January 10, 2019 01:02 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@trickster
trickster / download_urls.tsv
Last active November 28, 2018 02:47
Temple
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
TsvHttpData-1.0
http://download.pytorch.org/whl/cpu/torch-0.4.1-cp35-cp35m-linux_x86_64.whl 91083839 Ljut1FZhQjeRAymcCA9ckQ==