This file contains 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
using System; | |
using System.Linq.Expressions; | |
using PostSharp.Aspects; | |
namespace BindingTest | |
{ | |
class Program | |
{ | |
static void Main() | |
{ |
This file contains 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
# all logging settins are here on top | |
$logFile = "log-$(gc env:computername).log" | |
$logLevel = "DEBUG" # ("DEBUG","INFO","WARN","ERROR","FATAL") | |
$logSize = 1mb # 30kb | |
$logCount = 10 | |
# end of settings | |
function Write-Log-Line ($line) { | |
Add-Content $logFile -Value $Line | |
Write-Host $Line |
This file contains 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
# minimal example on how to put matplot lib graph into tkinter window | |
import tkinter as tk | |
import matplotlib.backends.backend_tkagg as tka | |
from matplotlib.figure import Figure | |
import numpy as np | |
win = tk.Tk() | |
fig = Figure() | |
canvas = tka.FigureCanvasTkAgg(fig, win) | |
toolbar = tka.NavigationToolbar2Tk(canvas, win) |
This file contains 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
#ghx-header.contains-breadcrumbs { | |
position: absolute; | |
right: 0; | |
width: 400px !important; | |
z-index: 999999999; | |
} | |
#breadcrumbs-container { | |
display: none !important; | |
} | |
#page-body > #content { |
This file contains 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
# Max-Heap data structure in Python | |
import math | |
def siftDown(arr, n, i): | |
largest = i | |
l = 2 * i + 1 | |
r = 2 * i + 2 | |
if l < n and arr[i] < arr[l]: | |
largest = l |
This file contains 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
# Keymap file for https://github.com/samvel1024/kbct | |
# Maps left Ctrl+Alt+hjkl to arrows. | |
- keyboards: ["AT Translated Set 2 keyboard"] | |
# Specify layered configurations (much similar to fn+F keys) | |
layers: | |
# Specify the modifiers of the layer | |
- modifiers: ['leftalt','leftctrl'] | |
keymap: |
This file contains 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
# this program shows how to pass payload from async client javascript to the server side in dash. | |
# you click on the button and the server logs the number of clicks. | |
# !pip install dash | |
import dash | |
from dash import html, Input, Output, dcc | |
app = dash.Dash(__name__) | |
app.layout = html.Div([ | |
html.Button('Click Me', id='button'), |
This file contains 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
//@version=4 | |
// data source: https://bitcointreasuries.com/microstrategy/ | |
study("MicroStrategy Bitcoin Purchase History", overlay=true) | |
x = if time > timestamp(2024, 6, 20, 0, 0) and time < timestamp(2024, 6, 21, 0, 0) | |
11931 | |
else if (time > timestamp(2024, 4, 1, 0, 0) and time < timestamp(2024, 4, 2, 0, 0)) | |
164 | |
else if (time > timestamp(2024, 3, 19, 0, 0) and time < timestamp(2024, 3, 20, 0, 0)) | |
9245 |