Skip to content

Instantly share code, notes, and snippets.

View zoltanctoth's full-sized avatar

Zoltan C. Toth zoltanctoth

View GitHub Profile
@saravargha
saravargha / LOTR_sentiment_analysis.R
Created December 7, 2021 15:23
LOTR Sentiment Analysis
## LOTR Sentiment Analysis
# Clean environment
rm(list=ls())
# Set up R with AWS
# Load libraries and install packages
library(aws.comprehend)
library(readtext)
@fulibacsi
fulibacsi / failstate.py
Last active April 23, 2021 00:18
Non-blocking exception catching context manager with step skipping and lightweight logging and reporting capabilities.
"""Non-blocking exception catching context manager with step skipping and
lightweight logging and reporting capabilities.
2021 - Andras Fulop @fulibacsi"""
import json
import sys
import traceback
import warnings
@zoltanctoth
zoltanctoth / print-without-newline.py
Last active October 21, 2020 10:28
Python print without newline. This script shows how you can use python to print a string without adding a newline.
# Print a string without adding a newline
print("Hey, Python prints without a newline.", end ="")
# Alternative solution
import sys
sys.stdout.write("Hey, Python prints without a newline.")
# You are part of an experiment on how well gists can be used as "StackOverflow".
# Please add a comment or a star if you found this useful. :) Thanks!
@ishad0w
ishad0w / sources.list
Created April 30, 2020 16:55
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@terry90
terry90 / unfollow.js
Last active May 13, 2024 10:32
LinkedIn mass unfollow
const SPEED = 150 // ms
// Open the console and paste this on linkedin.com/feed/following
function unfollowCurrent(elems, callback) {
console.log('Unfollowing ', elems.length, ' contacts')
elems.forEach(
(e, i) =>
setTimeout(() => e.click(), i * SPEED)
)
setTimeout(callback, elems.length * SPEED)
@mrandrewandrade
mrandrewandrade / tmux.cheat
Last active October 21, 2020 10:13 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^a w
New -s <session> Create ^a c
Attach a -t <session> Rename ^a , <name>
Rename rename-session -t <old> <new> Last ^a l (lower-L)
Kill kill-session -t <session> Close ^a &
@akhld
akhld / TestMain.java
Created June 4, 2015 07:31
Spark Streaming Listener Example
import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.streaming.Durations;
import org.apache.spark.streaming.api.java.JavaDStream;
import org.apache.spark.streaming.api.java.JavaStreamingContext;
import org.apache.spark.streaming.scheduler.*;
@owainlewis
owainlewis / PropertyBuilder.scala
Created May 1, 2015 15:58
Scala map to Java properties
import java.util.Properties
object PropertyBuilder {
/**
* Build a java Properties instance from a Scala Map
*
* @param properties An immutable map of properties
*/
def buildFromMap(properties: Map[String, String]) =
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active May 23, 2024 02:48
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@border
border / Makefile
Created January 12, 2011 01:36
json example in golang
include $(GOROOT)/src/Make.inc
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4
all:
$(GC) jsontest.go
$(LD) -o jsontest.out jsontest.$O
format:
$(GOFMT) -w jsontest.go