Skip to content

Instantly share code, notes, and snippets.

View conikeec's full-sized avatar

Chetan Conikee conikeec

View GitHub Profile
@conikeec
conikeec / macosx_remove_java9.sh
Created June 28, 2017 14:36 — forked from schnell18/macosx_remove_java9.sh
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@conikeec
conikeec / gist:d5cfdaa40a9625a3ad63c7c4ff2e48e2
Last active June 12, 2021 17:21
Kafka Install script
# KAFKA INSTALLER:
# downloads, un-tars, moves to $HOME/local, simlinks from full versioned name
# to kafka, exports into path in `.zshrc`, and then starts
# zookeeper and kafka server
brew install sbt # ensure sbt is installed first!
# current kafka for scala 2.12: http://apache.claz.org/kafka/0.10.2.0/kafka_2.12-0.10.2.0.tgz
SCALA_VERSION="2.12"
find . | grep "Cargo.toml$" | # Find all cargo.toml files \
sed 's#/[^/]*$##' | # Remove the filename leaving us with the directories containing cargo.toml files \
xargs -L1 printf "cd \"%s\"; cargo clean; cd -\n" | # Print "cd path/to/crate; cargo clean; cd -" \
bash # Execute
#[derive(Debug)]
struct TextEditor {
text: String,
}
impl TextEditor {
pub fn new(s: &'static str) -> Self {
TextEditor { text: String::from(s) }
}
python
import sys;
sys.path.append("/Users/chetanconikee/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/etc")
print "Loading Rust Pretty Printers"
sys.path.insert(0, "/Users/chetanconikee/.multirust/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/etc")
import gdb_rust_pretty_printing
gdb_rust_pretty_printing.register_printers(gdb)
#![feature(core_intrinsics)]
fn print_type_of<T>(_: &T) -> () {
let type_name =
unsafe {
std::intrinsics::type_name::<T>()
};
println!("{}", type_name);
}
#![allow(dead_code)]
#![allow(unused_variables)]
#[derive(Debug)]
struct Point<T> {
x:T,y:T
}
use std::ops::Add;
The #rustlang community is currently working to replace current toolchain manager
#Multirust (https://github.com/brson/multirust) with #Rustup (https://www.rustup.rs/)
Those wishing to replace #MultiRust with #RustUp, listed are steps in predefined order
1. Backup (and then) delete multirust and cargo folders from prior installation
curl -sf https://raw.githubusercontent.com/brson/multirust/master/quick-install.sh | sh -s -- --uninstall
rm -rf ~/.multirust
rm -rf ~/.cargo
@conikeec
conikeec / BitHacks
Created January 20, 2016 23:18
Bit Arithmetic
package main
import (
"fmt"
"math/big"
)
type BitSet struct {
bits big.Int
}
@conikeec
conikeec / gocode.sh
Created January 4, 2016 23:18
gocode autocomplete enablement for atom or sublime
gocode set package-lookup-mode "go" [or] gocode set package-lookup-mode "gb"
gocode set autobuild true
gocode close