Skip to content

Instantly share code, notes, and snippets.

View shriphani's full-sized avatar

Shriphani Palakodety shriphani

View GitHub Profile
@harsh183
harsh183 / simple-linked-list-data-class.kt
Last active April 17, 2021 11:03
Simple singly linked list using data classes in Kotlin using one line. Featuring data classes and null safety
// Linked list
data class Node<T>(var value: T, var next: Node<T>?);
fun main() {
val head = Node(1, null)
val second = Node(2, Node(3, null)) // two more (init multiple)
head.next = second
println(head.value) // 1
println(head.next?.value) // 2
@harsh183
harsh183 / functional_c++.cpp
Last active April 23, 2021 12:50
Basic and cool functional programmig concepts in C++14 onwards. Lots of auto abuse too for interesting type inference and results. Useful as a quick reference too. (Formatting is a bit wonky bc gist is weird sorry)
#include <iostream>
#include <string>
#include <vector>
#include <functional> // std::function, std::bind
#include <algorithm> // std::transform, std::remove_if
#include <numeric> // std::accumulate
using namespace std;
@abridgland
abridgland / gaussian-processes-1.ipynb
Last active October 10, 2023 07:49
A Jupyter notebook to accompany Intro to Gaussian Processes - Part I at http://bridg.land/posts/gaussian-processes-1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yocontra
yocontra / aoe2hd.md
Last active June 9, 2023 18:28
Age of Empires II HD - For Mac OSX
#!/bin/bash
#
# Requires:
# - gdal_sieve.py
# - ogr2ogr (GDAL)
# - topojson (node.js)
# Grab the relative directory for source file.
SRC_DIR=`dirname $0`
@hrbrmstr
hrbrmstr / continents.json
Created January 22, 2015 01:01
Continents GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rolandshoemaker
rolandshoemaker / editor.rs
Created December 28, 2014 17:35
Drop to $VISUAL or $EDITOR to edit a String in rust (via temporary file)
extern crate libc;
use std::io::{File, Open, ReadWrite, TempDir, Command, SeekSet};
use std::io::process::{InheritFd};
use std::os;
pub use self::libc::{
STDIN_FILENO,
STDOUT_FILENO,
STDERR_FILENO
};
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@jesperborgstrup
jesperborgstrup / ec_lsag_test.py
Last active March 11, 2023 21:23
Python implementation of Linkable Ring Signatures over Elliptic curves
# MIT License
#
# Copyright (C) 2014 Jesper Borgstrup
# -------------------------------------------------------------------
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
@shinmuro
shinmuro / mutable-deftype.clj
Last active January 5, 2021 22:10
Clojure deftype that has mutable field and setter method sample.
(defprotocol IEditName
(get-name [this])
(set-name! [this val]))
(deftype PersonName [^:volatile-mutable lname]
IEditName
(get-name [this] (. this lname))
(set-name! [this val] (set! lname val)))
(def pname (PersonName. "hoge"))