Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
@kdzwinel
kdzwinel / main.js
Last active June 23, 2026 19:24
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
@kevin-smets
kevin-smets / macOS_virtualbox.sh
Last active October 22, 2023 13:01 — forked from ryanmaclean/el_capitan_dmg_virtualbox.sh
Convert macOS installer for use in VirtualBox
#!/bin/bash
# Disclaimer: never got this to work properly and have not attempted it since.
# This will require about 30GB of space, still in experimental phase right now
sudo gem install iesd
cd /Applications # Or wherever you hve the "Install 10.12 Developer Preview.app" available
iesd -i Install\ 10.12\ Developer\ Preview.app -o macos.dmg -t BaseSystem
hdiutil convert macos.dmg -format UDSP -o macos.sparseimage
@jacoby
jacoby / project_share.sql
Created September 25, 2015 13:54
Two very similar SQL queries
SELECT p.pi_id pi_id
, p.request_id request_id
, pi.alias alias
, p.project_path project_path
, pi.career pi_career
, pi.name pi_name
, us.id share_pi_id
, us.alias share_alias
, m.is_user is_user
, m.name name
@tomasbedrich
tomasbedrich / level0.py
Last active November 11, 2015 19:01
Web scraping in Python
#!/usr/bin/env python3
import sys
from requests import get
CRIME_CODE = 821 # = bribery
# make HTTP GET request for areas, parse them as JSON and access a list under a key "areas"
areas = get("http://mapakriminality.cz/api/areas", params={"level": 2}).json()["areas"]
@paulirish
paulirish / what-forces-layout.md
Last active September 9, 2026 06:11
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
@vik-y
vik-y / delete_all_tweets.py
Last active September 22, 2023 21:04 — forked from davej/delete_all_tweets.py
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script is forked originally from Dave Jeffery. The original implementation
was very slow and deleted around 2 tweets per second. Making it multithreaded I
am able to delete 30-50 tweets per second.
@author: vik-y
----------------------------------------------------------------------------
This script will delete all of the tweets in the specified account.
@Sigmus
Sigmus / country.js
Created August 31, 2015 21:55
Country Name
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;

layout: post title: Next circular array item

A function that returns the next item in a given array. Starts over when the last item is reached.

var next = nextCircularItem(['x', 'y', 'z']);
@felixbuenemann
felixbuenemann / ghc.rb
Last active April 21, 2021 23:54
Homebrew formula for official ghc 7.10.2 binaries
class Ghc < Formula
desc "Glorious Glasgow Haskell Compilation System"
homepage "https://haskell.org/ghc/"
url "https://downloads.haskell.org/~ghc/7.10.2/ghc-7.10.2-x86_64-apple-darwin.tar.xz"
sha256 "ef0f00885096e3621cec84a112dfae050cf546ad39bdef29a7719407c6bc5b36"
def install
system "./configure", "--prefix=#{prefix}"
ENV.deparallelize { system "make", "install" }
@tommybutler
tommybutler / gist:4316212118279ffa5694
Created July 24, 2015 15:45
Quickly generate a bunch files with random content
for i in `seq -f "%02g" 0 200`; do dd if=/dev/random of=${i}.test bs=1M count=1; done