Skip to content

Instantly share code, notes, and snippets.

@foogaz
foogaz / tampermonkey_vk_stories_removal.js
Created May 4, 2024 05:54
remove stories from vk feed
// ==UserScript==
// @name vk stories removal
// @namespace http://tampermonkey.net/
// @version 1.0
// @description try to take over the world!
// @author foo
// @match *://vk.com/*
// @icon https://vk.com/images/icons/favicons/fav_logo_2x.ico
// @grant none
// ==/UserScript==
@foogaz
foogaz / tampermonkey_youtube_clear_url.js
Last active May 4, 2024 05:55
remove trash si and feature params from youtube share link
// ==UserScript==
// @name remove trash params from you2be share lynx
// @namespace https://foo.namespace.example.com
// @version 1.0
// @description Removes the 'si' and 'feature' parameters from YouTube share links.
// @author foo
// @match *://www.youtube.com/*
// @icon https://www.youtube.com/s/desktop/7c0eb0c2/img/favicon.ico
// @grant none
// ==/UserScript==
@foogaz
foogaz / Default Dark.sublime-theme
Last active June 9, 2023 08:21
Dracula Sublime Text Theme (modified Default Dark.sublime-theme)
/*
1] Ctrl+Shift+P > UI: Select Theme > Default Dark (or Auto if using system dark mode)
2] Ctrl+Shift+P > UI: Customize Theme > Add rules
*/
// Dracula color palette https://draculatheme.com/contribute
// Documentation at https://sublimetext.com/docs/themes.html
{
"variables": {
"background": "rgb(40, 42, 54)",
"current line": "rgb(68, 71, 90)",
@foogaz
foogaz / lxml_with_encoding.py
Created November 10, 2021 12:52
XML Unicode strings with encoding declaration are not supported
# https://stackoverflow.com/a/38244227
# https://gist.github.com/karlcow/3258330#gistcomment-769151
>>> from lxml import etree
>>> xml = u'<?xml version="1.0" encoding="utf-8" ?><foo><bar/></foo>'
>>> xml = bytes(bytearray(xml, encoding='utf-8')) # ADDENDUM OF THIS LINE (when unicode means utf-8, e.g. on Linux)
>>> etree.XML(xml)
<Element html at 0x5b44c90>
@foogaz
foogaz / curl.md
Created October 25, 2021 14:12 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@foogaz
foogaz / fizzbuzz.java
Created October 24, 2021 07:58
FizzBuzz Solution in Java
/*
https://howtodoinjava.com/java/puzzles/fizzbuzz-solution-java/
*/
// Solve FizzBuzz in Java 8
IntStream.rangeClosed(1, 100)
.mapToObj(i -> i % 5 == 0 ? (i % 7 == 0 ? "FizzBuzz" : "Fizz") : (i % 7 == 0 ? "Buzz" : i))
.forEach(System.out::println);
@foogaz
foogaz / styles_noactionbar.xml
Created September 27, 2015 07:09 — forked from tshrkmd/styles_noactionbar.xml
Theme.AppCompat.Light.NoActionBar
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.AppCompat.Light.NoActionBar" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item> <!-- For 2.x version -->
</style>
</resources>