Skip to content

Instantly share code, notes, and snippets.

View trickster's full-sized avatar
🎯
Focusing

Sivaram Konanki trickster

🎯
Focusing
View GitHub Profile
@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 / application.confg
Created November 14, 2018 07:57
Example: Minimal HTTP server for static content using Scala and Akka - HTTP
akka.http.server {
parsing {
max-content-length = 110M
}
}
akka {
loglevel = DEBUG
}
@trickster
trickster / compile_julia.ipynb
Last active October 2, 2018 09:09 — forked from goropikari/compile_julia.ipynb
How to compile julia?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@trickster
trickster / advanced_rust.rs
Last active October 2, 2018 10:08 — forked from rust-play/playground.rs
Advanced Rust - Threads, concurrency, vectors, ownership, iterators and traits for the living.
// What is ? in Rust?
// ? is almost1 exactly equivalent to an unwrap which returns instead of panics on Errs.
// Threads
// Concurrency
// Vectors
// Ownership and borrowing ofcourse
// Iterators
// Traits
@trickster
trickster / traits_ref.rs
Last active May 22, 2018 14:49 — forked from rust-play/playground.rs
Display trait and ref vs & too!!
// https://github.com/rust-lang/rust-by-example/issues/390
#[allow(unused_imports)]
use std::fmt;
#[derive(Debug)]
enum List {
Cons(i32, Rc<List>),
Nil,
}
@trickster
trickster / tests.rs
Created May 20, 2018 13:02 — forked from rust-play/playground.rs
Include rust tests in your code
#[derive(Debug)]
pub struct Rectangle {
length: u32,
width: u32,
}
impl Rectangle {
pub fn can_hold(&self, other: &Rectangle) -> bool {
self.length > other.length && self.width > other.width
}
@trickster
trickster / traits.rs
Last active May 20, 2018 12:19 — forked from rust-play/playground.rs
Traits, trait bounds and lifetimes
// use aggregator::Summary; - to import from the
// other crates
/*
TRAIT BOUNDS
we implemented the Summary trait on the types NewsArticle and Tweet.
We can define a function notify that calls the summarize method
on its parameter item, which is of the generic type T.
@trickster
trickster / playground.rs
Created May 20, 2018 05:20 — forked from rust-play/playground.rs
Reference counting
enum List {
Cons(i32, Rc<List>),
Nil,
}
use std::rc::Rc;
use List::{Cons, Nil};
#[allow(unused_variables)]
fn main() {
@trickster
trickster / exercise.tour.go
Created April 28, 2018 09:04 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@trickster
trickster / startup.jl
Last active April 24, 2018 04:54 — forked from MikeInnes/startup.jl
Julia macros (forked)
#=
## Taken from Old Julia documentation.
Escape analysis - (esc(n))
An expression wrapped in this manner is left alone by
the macro expander and simply pasted into the output verbatim.
Therefore it will be resolved in the macro call environment.
An expression wrapped in this manner is left alone by the macro expander
and simply pasted into the output verbatim.