Skip to content

Instantly share code, notes, and snippets.

View vforge's full-sized avatar
🔜
Great things!

Bartosz V. Bentkowski vforge

🔜
Great things!
View GitHub Profile
@sebastianmarzjan
sebastianmarzjan / compareCaches.php
Last active May 10, 2016 09:04
CDB dump comparer
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
function checkLang($lang) {
$s1 = unserialize(file_get_contents('./dump_dev/messageCache.dump.' . $lang . '.php'));
$s2 = unserialize(file_get_contents('./dump_374/messageCache.dump.' . $lang . '.php'));
$k1 = array_keys($s1);
@sebastianmarzjan
sebastianmarzjan / checkMessageCache.php
Last active May 10, 2016 09:04
Run from /usr/wikia/slot1/current/maintenance with $sudo SERVER_ID=177 php checkMessageCache.php
<?php
require_once( dirname( __FILE__ ) . '/commandLine.inc' );
error_reporting( E_ALL );
ini_set( 'display_errors', 'On' );
foreach ( Language::getLanguageNames() as $languageCode => $languageName ) {
$lang = Language::factory( $languageCode );
$mc = $lang->getLocalisationCache();
@Chandler
Chandler / slack_history.py
Last active March 27, 2025 01:16
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
@paulirish
paulirish / what-forces-layout.md
Last active October 18, 2025 17:10
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@Citillara
Citillara / kb-uninstall.bat
Last active January 17, 2024 12:26
Windows 7 updates to remove to prevent telemetry collection. Disables automatic upgrade to Windows 10
:: Removes most telemetry/data collection/potentially unwanted behavior from Windows 7
:: Disables the automatic download of Windows 10
:: Note : be careful to keep KB in descending order
:: Comment that line to restore prompts for uninstall/reboot
:: Thanks to https://gist.github.com/geoffroyjabouley
set WUSA_OPTIONS=/quiet /norestart
:: Removes Windows 7-8.1 telemetry (part 1)
wusa %WUSA_OPTIONS% /uninstall /kb:3080149
@karpathy
karpathy / min-char-rnn.py
Last active October 20, 2025 02:21
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
anonymous
anonymous / CSS-linear-gradient-overlay.markdown
Created April 15, 2015 10:34
CSS linear-gradient overlay

CSS linear-gradient overlay

⚠ Only works properly in Firefox for now - the tool will be displayed in other browsers, but if you change the color formats from rgb[a] to something else, the overlay won't update ⚠

This tool overlays information on top of a CSS linear-gradient to help understand how it is rendered in browsers.

If you read the spec (http://dev.w3.org/csswg/css-images/#linear-gradients) carefully, you'll learn a tone of details about how linear gradients are constructed you might not know. This tool's goal is to make it more obvious how the gradient angle is calculated and how the color stops are positioned.

Tool usage:

anonymous
anonymous / JS-♥-#4:-polygon-magnetism.markdown
Created April 8, 2015 13:03
JS ♥ #4: polygon magnetism
@DenisFromHR
DenisFromHR / RPi_I2C_driver.py
Last active August 24, 2025 16:56
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
@cletusw
cletusw / .eslintrc
Last active October 18, 2025 21:45
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names