Skip to content

Instantly share code, notes, and snippets.

View gorros's full-sized avatar

Gor Hayrapetyan gorros

  • Yerevan
View GitHub Profile
@amuradyan
amuradyan / ChurchEncodings.worksheet.sc
Last active May 24, 2022 18:22
Some Church encodings
type Boolian = (Any, Any) => Any
val troo = (a: Any, _: Any) => a
val fols = (_: Any, b: Any) => b
// Logic
val not = (b: Boolian) => b(fols, troo)
not(troo) == fols
@ovelny
ovelny / monaco-font-fix.md
Last active December 7, 2021 07:00
Fix pixelated Monaco Font (Google Chrome, Firefox...) on Linux

TL;DR: solution is to disable embedded bitmaps, either for all fonts or Monaco font

  • Create a file named 20-no-embedded.conf in ~/.config/fontconfig/conf.d/
  • To disable this behavior with all fonts, add this in your file:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="font">
@joshlk
joshlk / faster_toPandas.py
Last active July 22, 2024 14:15
PySpark faster toPandas using mapPartitions
import pandas as pd
def _map_to_pandas(rdds):
""" Needs to be here due to pickling issues """
return [pd.DataFrame(list(rdds))]
def toPandas(df, n_partitions=None):
"""
Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is
repartitioned if `n_partitions` is passed.
@tmcgrath
tmcgrath / Spark SQL with Scala using mySQL (JDBC) data source
Created January 6, 2016 17:32
Using Spark Console, connect and query a mySQL database. This is applicable to any database with JDBC driver though
todd-mcgraths-macbook-pro:spark-1.4.1-bin-hadoop2.4 toddmcgrath$ bin/spark-shell --jars mysql-connector-java-5.1.38-bin.jar
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 1.4.1
/_/
Using Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_66)
Type in expressions to have them evaluated.
@tanksuzuki
tanksuzuki / supervisor.txt
Last active November 20, 2020 00:05
yum install supervisor
[root@a59c35ad939a /]# yum install epel-release
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* extras: ftp.riken.jp
* rpmforge: ftp.riken.jp
* updates: ftp.riken.jp
Resolving Dependencies
--> Running transaction check
@davej
davej / delete_all_tweets.py
Last active August 12, 2024 16:20
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script will delete all of the tweets in the specified account.
You may need to hit the "more" button on the bottom of your twitter profile
page every now and then as the script runs, this is due to a bug in twitter.
You will need to get a consumer key and consumer secret token to use this
script, you can do so by registering a twitter application at https://dev.twitter.com/apps
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1)