Skip to content

Instantly share code, notes, and snippets.

View thirukkural2022's full-sized avatar

mv thirukkural2022

View GitHub Profile
@thirukkural2022
thirukkural2022 / Stemmer.java
Created November 23, 2021 02:25 — forked from ldclakmal/Stemmer.java
Stemmer, implementing the Porter Stemming Algorithm
package DM;
/*
Porter stemmer in Java. The original paper is in
Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14,
no. 3, pp 130-137,
See also http://www.tartarus.org/~martin/PorterStemmer
@thirukkural2022
thirukkural2022 / cqlsh_intro.cql
Created May 17, 2021 09:51 — forked from jeffreyscarpenter/cqlsh_intro.cql
Introduction to CQL / cqlsh
#
# cqlsh_intro.cql
#
# Copyright (C) 2017 Jeff Carpenter
# Execute the commands in this file for a short guided tour of the CQL Shell (cqlsh)
#
# For more description, see Cassandra, The Definitive Guide 2nd Ed., Chapter 3: Installing
# http://shop.oreilly.com/product/0636920043041.do
#
@thirukkural2022
thirukkural2022 / .vimrc
Created December 28, 2020 23:05 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@thirukkural2022
thirukkural2022 / hosting-on-github.md
Created August 14, 2020 07:29 — forked from TylerFisher/hosting-on-github.md
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
object final_encoded_email_filter {
final case class Address(emailAddress: String)
final case class Email(sender: Address, to: List[Address], subject: String, body: String)
case class EmailFilter(run: Email => Boolean) { self =>
def &&(that: EmailFilter): EmailFilter = EmailFilter(email => self.run(email) && that.run(email))
def ||(that: EmailFilter): EmailFilter = EmailFilter(email => self.run(email) || that.run(email))
def negate : EmailFilter = EmailFilter(email => !self.run(email))
@thirukkural2022
thirukkural2022 / functional-dsl-blog-7.scala
Created June 16, 2020 00:57 — forked from ruurtjan/functional-dsl-blog-7.scala
Initial encoded email filter example
object initial_encoded_email_filter {
final case class Address(emailAddress: String)
final case class Email(sender: Address, to: List[Address], subject: String, body: String)
sealed trait EmailFilter { self =>
def &&(that: EmailFilter): EmailFilter = EmailFilter.And(self, that)
def ||(that: EmailFilter): EmailFilter = (self.negate && that.negate).negate
def negate : EmailFilter = EmailFilter.Not(self)
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@thirukkural2022
thirukkural2022 / StaticFile.scala
Created May 16, 2019 17:27 — forked from bmc/StaticFile.scala
I needed code to serve static files from an Akka HTTP server. I wanted to use fs2 to read the static file. Michael Pilquist recommended using streamz to convert from an fs2 Task to an Akka Source. This is what I came up with. (It does actually work.)
object StaticFile {
// Various necessary imports. Notes:
//
// 1. fs2 is necessary. See https://github.com/functional-streams-for-scala/fs2
// 2. streamz is necessary. See https://github.com/krasserm/streamz
// 3. Apache Tika is used to infer MIME types from file names, because it's more reliable and
// fully-featured than using java.nio.file.Files.probeContentType().
//
// If using SBT, you'll want these library dependencies and resolvers:
@thirukkural2022
thirukkural2022 / application.confg
Created May 16, 2019 17:17
Example: Minimal HTTP server for static content using Scala and Akka - HTTP
akka.http.server {
parsing {
max-content-length = 110M
}
}
akka {
loglevel = DEBUG
}
@thirukkural2022
thirukkural2022 / gist:ce1c62b647bbec7f31f0a555c59004bb
Created November 5, 2018 16:40 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht