Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vijaykiran
vijaykiran / test.py
Created November 23, 2021 17:12
Save failed rows ....
from sodasql.scan.scan_builder import ScanBuilder
from sodasql.scan.failed_rows_processor import FailedRowsProcessor
class TestFailedRowProcessor(FailedRowsProcessor):
def process(self, context: dict):
sample_name = context.get('sample_name')
column_name = context.get('column_name')
sample_columns = context.get('sample_columns')
sample_description = context.get('sample_description')
(ns adoc.core
(:require [clojure.string :as str]))
(defn parse-name [room]
(let [parsed (str/split room #"-")
name (drop-last parsed)
sector-checksum (str/split (last parsed) #"\[")
sector (first sector-checksum)
checksum (str/replace (last sector-checksum) "]" "")]
{:room-name name
RUST_BACKTRACE=1 ./target/debug/datamorpher < uspop.csv
thread 'main' panicked at 'a CSV record: StringRecord(["Davidsons Landing", "AK", "", "65.2419444", "-165.2716667"])', src/libcore/result.rs:1009:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:211
hello_world git:(upstream ⚡ detached@a4dcb0c) ₹ rustup default nightly
info: using existing install for 'nightly-x86_64-apple-darwin'
info: default toolchain set to 'nightly-x86_64-apple-darwin'
nightly-x86_64-apple-darwin unchanged - rustc 1.33.0-nightly (7bac68a5d 2019-01-21)
hello_world git:(upstream ⚡ detached@a4dcb0c) ₹ cargo +nightly build
error: no such subcommand: `+nightly`
hello_world git:(upstream ⚡ detached@a4dcb0c) ₹ cargo run
warning: Rocket was unable to check rustc compatibility.
@vijaykiran
vijaykiran / bashstyle.md
Created November 30, 2018 14:46 — forked from outro56/bashstyle.md
Bash scripting best practices (copied from https://github.com/progrium/bashstyle/blob/master/README.md)

progrium/bashstyle

Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne

@vijaykiran
vijaykiran / keybase.md
Created October 2, 2017 21:25
keybase.md

Keybase proof

I hereby claim:

  • I am vijaykiran on github.
  • I am vijaykiran (https://keybase.io/vijaykiran) on keybase.
  • I have a public key ASChck_zcupSrs77kvXgz6Sit6s_93LtQs1e6BzIuXS_iwo

To claim this, I am signing this object:

@vijaykiran
vijaykiran / planck-dependency.md
Created July 28, 2016 14:21 — forked from borkdude/planck-dependency.md
Fast REPL session with a cljs library using Planck

Get a fast starting REPL session with a ClojureScript library using Planck.

First, decide what dependencies Planck needs to load. This is easily done with boot like this:

$ boot --dependencies org.clojars.micha/boot-cp        ; load with-cp task that helps exporting minimal classpath to file
   --dependencies com.andrewmcveigh/cljs-time:"0.4.0"  ; load dependency you actually want to try
   with-cp -w --file .classpath                        ; write classpath to a file `.classpath`

The list of dependencies is now written to .classpath. You can re-use this file if you're dependency hasn't changed.

Debugger entered--Lisp error: (wrong-type-argument stringp ("Org-Agenda" "" " " (:eval (org-agenda-span-name org-agenda-current-span)) "" "" "" " Ddl" " Grid" "" "" "" "" "" "" "" ""))
compare-strings("Helm" nil nil ("Org-Agenda" "" " " (:eval (org-agenda-span-name org-agenda-current-span)) "" "" "" " Ddl" " Grid" "" "" "" "" "" "" "" "") 0 4 nil)
string-prefix-p("Helm" ("Org-Agenda" "" " " (:eval (org-agenda-span-name org-agenda-current-span)) "" "" "" " Ddl" " Grid" "" "" "" "" "" "" "" ""))
(or (string-prefix-p " " (buffer-name b)) (string-prefix-p "Helm" (buffer-local-value 'mode-name b)))
(lambda (b) (or (string-prefix-p " " (buffer-name b)) (string-prefix-p "Helm" (buffer-local-value 'mode-name b))))(#<buffer *Org Agenda*>)
byte-code("\305!\306\211\f\211A\242\211\203A\307\n!\203\n !\2026\n\211A\242\211\203 !\203\310\311\312\"\210\202\203\310\311\312\"\210\202+\306\207" [buff-or-name f filter buf filters get-buffer nil functionp throw --cl-block-pbfop-- t] 3)
persp-buff
@vijaykiran
vijaykiran / about.md
Created February 5, 2016 07:16 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
divides m n = n `rem` m == 0
divisors :: Int -> [Int]
divisors n = [k | k <- [1..n], k `divides` n]
sigma = sum . divisors
output :: Int -> String
output n
| sigma n > 2 * n = show n ++ " abundant "++ show (sigma n - 2 * n)