Skip to content

Instantly share code, notes, and snippets.

View Albert221's full-sized avatar
💻

Albert Wolszon Albert221

💻
View GitHub Profile
@Albert221
Albert221 / proxy_value_listenable.dart
Last active June 17, 2022 12:26
ProxyValueListenable<T> for Flutter
import 'package:flutter/foundation.dart';
class ProxyValueListenable<T> implements ValueListenable<T> {
ProxyValueListenable(this._parent) {
_parent.addListener(_listener);
}
final _listeners = <VoidCallback>[];
ValueListenable<T> _parent;
@Albert221
Albert221 / JetBrains-Mono.css
Last active May 7, 2024 00:30
CSS for using JetBrains Mono on the Web. Simply copy&paste it to your stylesheet.
@font-face {
font-family: 'JetBrains Mono';
src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Bold-Italic.woff2') format('woff2'),
url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff/JetBrainsMono-Bold-Italic.woff') format('woff');
font-weight: 700;
font-style: italic;
font-display: swap;
}
@font-face {

Custom Gutenberg Block

This is a basic custom Gutenberg block. Files explained below.

  • block.js — We register Custom Gutenberg block here.
  • editor.css _ Block CSS for the editor.
  • style.css — Block CSS for the front end.
  • index.php — Enqueue block's assets for editor and the front end.
@iamsaso
iamsaso / index.html
Last active September 21, 2022 11:04
GraphiQL with JWT
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 100%;
margin: 0;
width: 100%;
overflow: hidden;
}
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@odan
odan / xampp_php7_xdebug.md
Last active June 28, 2024 12:58
Installing Xdebug for XAMPP
@wittx
wittx / max.lua
Created August 11, 2015 10:59
maxTableValue
local function maxTableValue(tab)
if not tab[1] then return 0; end
local value = tab[1];
for i = 2, #tab do
if value < tab[i] then
value = tab[i];
end
end
return value;
@turret-io
turret-io / aes_enc_dec.php
Last active June 5, 2024 21:34
AES encryption/decryption in PHP
<?php
// DEFINE our cipher
define('AES_256_CBC', 'aes-256-cbc');
// Generate a 256-bit encryption key
// This should be stored somewhere instead of recreating it each time
$encryption_key = openssl_random_pseudo_bytes(32);
// Generate an initialization vector
// This *MUST* be available for decryption as well
@SimonSimCity
SimonSimCity / pagination.html.twig
Last active September 30, 2023 17:29
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <simonsimcity@gmail.com>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@paulmillr
paulmillr / active.md
Last active June 24, 2024 13:58
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)