Skip to content

Instantly share code, notes, and snippets.

View stefanoschrs's full-sized avatar
🐒
Coding or Running

Stefanos Chrs stefanoschrs

🐒
Coding or Running
View GitHub Profile
@stefanoschrs
stefanoschrs / app.js
Created August 4, 2023 06:24
Google Chat - Dark mode
var r = document.querySelector(':root');
r.style.setProperty('--background-color', '#333');
r.style.setProperty('--primary-line-color', '#222');
r.style.setProperty('--stream-container-background-color', '#222');
r.style.setProperty('--primary-text-color', '#fff');
r.style.setProperty('--secondary-text-color', '#ddd');
r.style.setProperty('--conversation-header-primary-text-color', '#fff');
r.style.setProperty('--header-text-color', '#fff');
r.style.setProperty('--postbar-button-icon-color', '#fff');
r.style.setProperty('--icon-color', '#fff');
@stefanoschrs
stefanoschrs / linkedin-ads-remover.js
Created October 27, 2021 07:48
Remove LinkedIn Ads
function watchAndRemoveAds () {
const MutationObserver = window.MutationObserver || window.WebKitMutationObserver
const mo = new MutationObserver(debounce(onMutation, 500))
mo.observe(document.querySelector('main#main'), { childList: true, subtree: true })
function debounce (fun, timeout) {
let timer
return (...args) => {
clearTimeout(timer)
timer = setTimeout(() => fun.apply(this, args), timeout)
@stefanoschrs
stefanoschrs / README.md
Last active September 22, 2021 15:27
JetBrains Academy - Knowledge Map
@stefanoschrs
stefanoschrs / add-frame.sh
Created August 9, 2019 15:36
deviceframe iPhone X hack
outputDir=/tmp/screenshots/framed
mkdir -p ${outputDir}
##########
# iPhone #
##########
padPath=/tmp/iphone-pad.png
convert -size 1125x185 xc:#e65562 ${padPath}
for filePath in $(find /tmp/screenshots/ | grep iPhone | grep -v framed) ; do
@stefanoschrs
stefanoschrs / fill.js
Created December 3, 2018 09:51
Flex grid fill last row
const W = 4
function fill(x) {
for(let i=0; i<x; i+=W){
for(let j=0; j<W && i + j < x; j++) {
process.stdout.write('x')
}
if (i < x - W && parseInt(i/W) === i/W) {
console.log()
}
@stefanoschrs
stefanoschrs / receiver.py
Created September 25, 2017 16:31
Get files through TCP
import socket
import time
import os
s = socket.socket()
host = socket.gethostname()
port = os.getenv('PORT') if 'PORT' in os.environ else '8080'
print 'Starting Receiver on %s:%s' % (host, port)
s.bind(('', int(port)))
# Chrome >= 20
['Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36','Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36','Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36','Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36','Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36','Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36','Mozilla/5.0 (Macintosh; Inte
@stefanoschrs
stefanoschrs / sync.sh
Created September 24, 2016 15:31
Sync a GitHub fork
git remote -v
# List the current remotes
# origin https://github.com/user/repo.git (fetch)
# origin https://github.com/user/repo.git (push)
git remote add upstream https://github.com/otheruser/repo.git
# Set a new remote
git remote -v
# Verify new remote
@stefanoschrs
stefanoschrs / keybase.md
Last active November 9, 2016 18:52
Keybase Proof

Keybase proof

I hereby claim:

  • I am stefanoschrs on github.
  • I am stefanoschrs (https://keybase.io/stefanoschrs) on keybase.
  • I have a public key ASC922chLFEB7jPqlFATIx7wPGp24OAfu4IbIA06mV5zlwo

To claim this, I am signing this object:

@stefanoschrs
stefanoschrs / geolocationHelper.js
Last active August 10, 2016 15:56
Geolocation Functions
var GeolocationHelper = (function(geolocationHelper){
'use strict';
geolocationHelper.getBearing = getBearing;
geolocationHelper.getDistance = getDistance;
var _toRad = function(deg) {
return deg * Math.PI / 180;
};
var _toDeg = function(rad) {