Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View vijayanandrp's full-sized avatar
👑

Vijay Anand Pandian vijayanandrp

👑
View GitHub Profile
@rueedlinger
rueedlinger / kconnect.py
Last active January 3, 2023 16:46
Kafka Connect Python Script
import sys
import os
import json
import argparse
PYTHON_MAJOR_VERSION = sys.version_info.major
DEFAULT_HOST = 'localhost'
DEFAULT_PORT = '8083'
BASE_PATH = '/connectors'
@satorg
satorg / scala-compile-server-options.md
Last active March 20, 2022 09:05
HOWTO FIX: "Warning:scalac: Cannot connect to compile server at localhost/127.0.0.1:3200 Trying to compile without it"

Applicable for:

  • IntelliJ IDEA CE 2019.1 (2018.* – ?)
  • macOS Mojave
  • may also work for other IDEA/macOS versions

Steps to fix:

  1. Go to directory ~/Library/Preferences/IdeaIC${IDEA_VERSION}/
    • for IntelliJ IDEA CE 2019.1: ~/Library/Preferences/IdeaIC2019.1/.
  2. There're two files in this directory:
  • ./settingsRepository/repository/scala.xml;
{
"packages": [
{
"name": "auk",
"description": "eBird Data Extraction and Processing in R",
"details": "Extract and process bird sightings records from eBird \n (<http://ebird.org>), an online tool for recording bird observations. \n Public access to the full eBird database is via the eBird Basic Dataset \n (EBD; see <http://ebird.org/ebird/data/download> for access), a downloadable \n text file. This package is an interface to AWK for extracting data from the \n EBD based on taxonomic, spatial, or temporal filters, to produce a \n manageable file size that can be imported into R.",
"maintainer": "Matthew Strimas-Mackey",
"keywords": "dataset, ebird",
"github": "https://github.com/CornellLabofOrnithology/auk",
"status": {
@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@rraval
rraval / postgres-collation.md
Last active December 6, 2023 16:25
PostgreSQL collation is a massive footgun

This is a slightly stripped down version from our internal bug tracker. The point of posting this publicly is part FYI, part peer review. I'm hoping someone can look at this, disagree, and tell me all the downsides of using the C locale or point out things I've misunderstood. The Recommendations section in particular is contextualized by our database serving a SaaS product for users from many different locales, thus making locale a render level concern. YMMV, caveat emptor, etc.


Collation defines the character ordering for textual data. For Postgres, https://www.postgresql.org/docs/current/static/locale.html:

The locale settings influence the following SQL features:

  • Sort order in queries using ORDER BY or the standard comparison operators on textual data
  • The upper, lower, and initcap functions
@frne
frne / Schema2CaseClass.scala
Last active May 6, 2022 20:23
Spark DataFrame Schema to Scala Case Class Generator
object Schema2CaseClass {
import org.apache.spark.sql.types._
case class RecFieldRes(fieldStr: String, additionalCc: Option[String] = None)
case class CcRes(cc: String, additional: List[String])
def schema2Cc(schema: StructType, className: String): String = {
val res = CcRes(s"case class $className (\n", Nil)
@parkj90
parkj90 / wikiCrawler.py
Last active May 25, 2017 19:06
wikipedia challenge
import sys
import requests
from lxml import html
import time
if len(sys.argv) < 2:
print("Usage: {} URL [page jump limit]".format(sys.argv[0]))
exit()
link = sys.argv[1]
@suriyadeepan
suriyadeepan / rnn_madurai.txt
Created January 5, 2017 15:38
Text generated by 4-layer Stacked RNN, trained on Project Madurai
அத்தனையு மீடுவேன் புன்கழலிணைகொடுத்துயர்ந்து
பொய்கைப்புனை மரடும் புதுவையாய்
மாலுழல்
ஈறுஞ்சத் திருப்பாதங்கள் கருருவாய் என் றரு ளாய கிழகூடுதீடுசித்தன்னைக்கொண்டு விளங்க உனைக்காக்கொண்டு
தீட்ட படுஞ் தென்னன் எம்பெருமை
இடிமுனிசெயில் இணைபொருதரும்
அறுசீர் நுவனையன்
வானே புகழுக்கும் அளுவாய் ஆண்டுட்டு போங்கேவந்து
தேவ புலாவரும் அறுத்தாற்பொழுங்காதே
உலகீண்டுறும்
@redapple
redapple / in_container_console_logs.txt
Created June 17, 2016 11:21
Installing scrapy 1.1 on Ubuntu 16.04 on Python 3, using virtualenvwrapper
# --- install system dependencies (sudo apt-get install)
scrapyuser@8fb08da8f18b:/$ sudo apt-get install python3 python-dev python3-dev \
> build-essential libssl-dev libffi-dev \
> libxml2-dev libxslt-dev \
> python-pip
[sudo] password for scrapyuser:
Reading package lists... Done
Building dependency tree
Reading state information... Done
@benhoyt
benhoyt / ngrams.py
Created May 12, 2016 15:34
Print most frequent N-grams in given file
"""Print most frequent N-grams in given file.
Usage: python ngrams.py filename
Problem description: Build a tool which receives a corpus of text,
analyses it and reports the top 10 most frequent bigrams, trigrams,
four-grams (i.e. most frequently occurring two, three and four word
consecutive combinations).
NOTES