This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## LOTR Sentiment Analysis | |
# Clean environment | |
rm(list=ls()) | |
# Set up R with AWS | |
# Load libraries and install packages | |
library(aws.comprehend) | |
library(readtext) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
========================================== ========================================== | |
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 & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.*; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize the scroll | |
page = es.search( | |
index = 'yourIndex', | |
doc_type = 'yourType', | |
scroll = '2m', | |
search_type = 'scan', | |
size = 1000, | |
body = { | |
# Your query's body | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder