Discover gists
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.Numerics; | |
namespace Common | |
{ | |
/// <summary> | |
/// Arbitrary precision decimal. | |
/// All operations are exact, except for division. Division never determines more digits than the given precision. | |
/// Source: https://gist.github.com/JcBernack/0b4eef59ca97ee931a2f45542b9ff06d | |
/// Based on https://stackoverflow.com/a/4524254 |
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
REM Delete eval folder with licence key and options.xml which contains a reference to it | |
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do ( | |
for /d %%a in ("%USERPROFILE%\.%%I*") do ( | |
rd /s /q "%%a/config/eval" | |
del /q "%%a\config\options\other.xml" | |
) | |
) | |
REM Delete registry key and jetbrains folder (not sure if needet but however) | |
rmdir /s /q "%APPDATA%\JetBrains" |
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
import 'dart:math' as math; | |
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
class OutlinedInputBorder extends InputBorder { | |
/// Creates a rounded rectangle outline border for an [InputDecorator]. | |
/// | |
/// If the [borderSide] parameter is [BorderSide.none], it will not draw a | |
/// border. However, it will still define a shape (which you can see if |
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
class DataIdGenerator { | |
constructor() { | |
this.count = 0; | |
} | |
generateDataId() { | |
this.count++; | |
return this.formatDataId(this.count); | |
} |
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
from rest_framework.filters import OrderingFilter | |
class CustomOrderFilter(OrderingFilter): | |
allowed_custom_filters = ['user_city', 'user_country'] | |
fields_related = { | |
'user_city': 'user__city__name', # ForeignKey Field lookup for ordering | |
'user_country': 'user__country__name' | |
} | |
def get_ordering(self, request, queryset, view): |
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
#![allow(unused)] // silence unused warnings while exploring (to comment out) | |
use sqlx::postgres::{PgPoolOptions, PgRow}; | |
use sqlx::{FromRow, Row}; | |
// Youtube episode: https://youtu.be/VuVOyUbFSI0 | |
// region: Section | |
// Start postgresql server docker image: |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Delete Boxes</title> | |
<style> | |
.box { | |
width: 100px; | |
height: 100px; |
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
# iPhone with home button | |
xcrun simctl status_bar booted clear | |
xcrun simctl status_bar booted override \ | |
--time "9:41 AM" \ | |
--wifiBars 3 --cellularBars 4 --operatorName "" | |
xcrun simctl spawn booted defaults write com.apple.springboard SBShowBatteryPercentage 1 | |
# iPhone X | |
xcrun simctl status_bar booted clear | |
xcrun simctl status_bar booted override --time "9:41" --wifiBars 3 --cellularBars 4 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Delete Boxes</title> | |
<style> | |
.box { | |
width: 100px; | |
height: 100px; |
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
function countEmailsWithSearchTermsMonthly() { | |
var searchTerms = ['spearheading', 'delve']; // Replace with your actual search terms | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
// Clear previous data (if any) | |
var lastRow = sheet.getLastRow(); | |
if (lastRow > 1) { | |
sheet.getRange(2, 1, lastRow - 1, sheet.getLastColumn()).clear(); | |
} |
NewerOlder