Skip to content

Instantly share code, notes, and snippets.

View Firsh's full-sized avatar

Firsh Firsh

View GitHub Profile
@Firsh
Firsh / symptoms.md
Created June 10, 2021 10:44
Upswing and downswing symptoms from Howard Marks, Mastering the Market Cycle

The following progression serves to sum up regarding the upswing of the market cycle. It shows how cycles in economics, profits, psychology, risk aversion and media behavior combine to move market prices well beyond intrinsic value, and how one development contributes to the next.

  • The economy is growing, and the economic reports are positive.
  • Corporate earnings are rising and beating expectations.
  • The media carry only good news.
  • Securities markets strengthen.
  • Investors grow increasingly confident and optimistic.
  • Risk is perceived as being scarce and benign.
  • Investors think of risk-bearing as a sure route to profit.
  • Greed motivates behavior.
@Firsh
Firsh / functions.php
Last active December 15, 2020 11:13
JIG galleries by custom meta
<?php
//The new filters are called 'jig_media_library_query_args' and 'jig_recent_posts_query_args'
// Media Library queries
add_filter('jig_media_library_query_args', 'jig_change_media_library_query', 10, 2);
function jig_change_media_library_query ($args, $atts) {
$args['meta_key'] = 'your_custom_field_name'; // some start with an underscore
$args['meta_value'] = 'field_value';
return $args;
}
@Firsh
Firsh / install-vivaldi-custom-css.bat
Last active July 19, 2025 22:11
Install Vivaldi Custom CSS
@set installhooks_args=%*& set installhooks_self=%~f0& powershell -c "(gc \"%~f0\") -replace '@set installhooks_args.*','#' | Write-Host" | powershell -c -& goto :eof
$srcdir = split-path $env:installhooks_self
$vivpath = "c:\Program Files\Vivaldi\Application\"
Try {
$dstdir = split-path ((Get-ChildItem -path $vivpath -recurse browser.html | Sort-Object -property CreationTime -descending | Select-Object -first 1).FullName)
write-host "Destination directory: $dstdir"
$encoding = (New-Object System.Text.UTF8Encoding($False))
@Firsh
Firsh / custom.js
Created December 23, 2018 12:54
Copyright Copy Paste
function addLink() {
var content_element = document.getElementById('wtr-content');
var body_element = document.getElementsByTagName("body")[0]
var selection, newdiv;
if (window.getSelection) {
selection = window.getSelection();
}else{
var ypos = jQuery(document).scrollTop()
selection = readSelected(content_element)
jQuery(document).scrollTop(ypos)
@Firsh
Firsh / code.gs
Created October 30, 2018 10:12
Ez kell az IMPORTJSON-hoz
/**
* @OnlyCurrentDoc
*/
//Global Variables
var currSpreadsheet=SpreadsheetApp.getActiveSpreadsheet();// get current spreadsheet
var shtPortfolioSummary = currSpreadsheet.getSheetByName('Portfolio Summary');
var shtPortfolioHistory = currSpreadsheet.getSheetByName('Portfolio History');
var shtYahooDataRef = currSpreadsheet.getSheetByName('Yahoo Data Ref');
var shtYahooDataRefUSD = currSpreadsheet.getSheetByName('Yahoo Data Ref USD');
@Firsh
Firsh / lwp-cloudflare-dyndns.sh
Last active April 23, 2025 15:56
Cloudflare as Dynamic DNS
#!/bin/bash
# Cloudflare as Dynamic DNS
# From: https://letswp.io/cloudflare-as-dynamic-dns-raspberry-pi/
# Based on: https://gist.github.com/benkulbertis/fff10759c2391b6618dd/
# Original non-RPi article: https://phillymesh.net/2016/02/23/setting-up-dynamic-dns-for-your-registered-domain-through-cloudflare/
# Update these with real values
auth_email="[email protected]"
auth_key="global_api_key_goes_here"
zone_name="example.com"
$ sudo phpbrew install php-7.2.1 +default +dbs +mb +iconv +apxs2=/usr/bin/apxs2
*WARNING* You're runing phpbrew as root/sudo. Unless you're going to install
system-wide phpbrew or this might cause problems.
===> phpbrew will now build 7.2.1
===> Loading and resolving variants...
Downloading http://www.php.net/get/php-7.2.1.tar.bz2/from/this/mirror via curl extension
Redirecting to http://be2.php.net/distributions/php-7.2.1.tar.bz2
[==================================================================] 14.29/14.29MB 100%
===> Extracting /home/ubuntu/.phpbrew/distfiles/php-7.2.1.tar.bz2 to /home/ubuntu/.phpbrew/build/tmp.1517140904/php-7.2.1
===> Moving /home/ubuntu/.phpbrew/build/tmp.1517140904/php-7.2.1 to /home/ubuntu/.phpbrew/build/php-7.2.1
@Firsh
Firsh / selective-loader.php
Created June 6, 2017 16:18
Disable x plugin when not needed
<?php
// http://wordpress.stackexchange.com/questions/114345/load-plugin-selectively-for-pages-or-posts-etc
// http://codex.wordpress.org/Must_Use_Plugins
add_filter( 'option_active_plugins', 'enable_plugins_selectively' );
function enable_plugins_selectively( $plugins ) {
// Dont' mess with the plugins if it's the admin, yo
//if(is_admin() || stripos($_SERVER["SCRIPT_NAME"], strrchr(wp_login_url(), '/')) !== false){
@Firsh
Firsh / dummy-rss.xml
Created September 24, 2016 10:44
How to add any image to JIG
<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>Title of the test feed</title>
<description>To get external images to JIG</description>
<link>http://justifiedgrid.com/</link>
<item>
<title>The first photo</title>
<description><![CDATA[
<img src="http://dummyimage.com/600x600/3e2723/ff5722/&text=Dummy photo" />
@Firsh
Firsh / index-with-search.php
Created August 9, 2016 19:34
For meravjon
<?php
if (is_search()) {
if (array_key_exists('s', $wp->query_vars) && !empty($wp->query_vars['s'])) {
$the_search_query = $wp->query_vars['s'];
get_jig(array(
'preset' => '19',
'row_height' => '250',
'orderby' => 'title_asc',
'ng_intersect_tags' => 'yes',
'ng_search_options' => 'tag',