Skip to content

Instantly share code, notes, and snippets.

sbcd90 /
Created Sep 10, 2021 — forked from jeetsukumaran/
Build and Install GCC Suite from Scratch
#! /bin/bash
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install
sbcd90 / getLatestIstio.ps1
Created Feb 15, 2019 — forked from kameshsampath/getLatestIstio.ps1
The PowerShell script that can be used to download latest version of Istio analogus to
View getLatestIstio.ps1
[string] $IstioVersion = "0.3.0"
$url = "$($IstioVersion)/istio_$($IstioVersion)"
$Path = Get-Location
$output = [IO.Path]::Combine($Path, "istio_$($IstioVersion)
Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green
sbcd90 / EmbeddedList.scala
Last active Jul 14, 2017
A spark app to show how user specific data types(UDTs) can be made generic using Byte array serialize/deserialize & UTF8String.
View EmbeddedList.scala
package org.apache.spark.sql
import{ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream}
import org.apache.spark.SparkConf
import org.apache.spark.sql.catalyst.util.{ArrayData, GenericArrayData}
import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String
@SQLUserDefinedType(udt = classOf[EmbeddedListUDT])
sbcd90 /
Last active May 21, 2017
Graph Aware expiry module test
package org.neo4j.test;
import com.graphaware.neo4j.expire.ExpirationModule;
import com.graphaware.neo4j.expire.config.ExpirationConfiguration;
import com.graphaware.runtime.GraphAwareRuntime;
import com.graphaware.runtime.GraphAwareRuntimeFactory;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
sbcd90 / ReflectionTestApp.scala
Created Apr 1, 2017
Fun with scala reflection & toolbox api
View ReflectionTestApp.scala
import scala.reflect.runtime._
import scala.reflect.runtime.universe._
object ReflectionTestApp extends App {
val cm = universe.runtimeMirror(getClass.getClassLoader)
val toolBox = cm.mkToolBox()
public class WaitLockTestApp {
private static int sum = 0;
public static void main(String[] args) throws InterruptedException {
final WaitLockTestApp app = new WaitLockTestApp();
Thread thread1 = new Thread(new Runnable() {
import urllib
import urllib2
import json
import random
import time
min = 20
max = 60
url = ""
package org.example;
import java.util.concurrent.*;
class TestThread implements Runnable {
public final String name;
public final int newcount;
public final long newtimesleep;
public TestThread(String name, int newcount, long newtimeSleep) {
class SynchronizationTest {
public int i;
// synchronize locks a block of code printB or method like printA
// only one thread can access a synchronized block at a single point in time.
public synchronized void printA(int a) {
for (int count=0;count < 5;count++) {
sbcd90 / TypeClasses.scala
Created Jun 8, 2016
A simple typeclass sample
View TypeClasses.scala
object TypeClasses {
// the trait defined independent of thing(type A) & evidence(type CanFoo[A])
trait CanFoo[A] {
def foos(x: A): String
// object defined whose apply method takes an implicit param of type CanFoo[A]
object CanFoo {
def apply[A:CanFoo]: CanFoo[A] = implicitly