Skip to content

Instantly share code, notes, and snippets.

@RAnders00
RAnders00 / main.js
Created January 1, 2019 15:53
Add arbitrary chat delay in seconds
javascript:(function(){ let seconds = parseInt(prompt('Enter new chat delay option (in seconds):')); let ms = String(seconds * 1000); let newOption = document.createElement('option'); newOption.setAttribute('value', ms); newOption.setAttribute('data-test-selector', "chat-delay-radio:" + ms); newOption.text = seconds + " seconds"; document.querySelector('.chat-delay-menu > .tw-select').appendChild(newOption); })();
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@chinhodado
chinhodado / gist:6fc37def3e12ea09f785
Created January 9, 2015 02:57
How to use meld with Sourcetree on Windows
  • Install meld
  • Add location of meld.exe to the PATH, e.g. C:\Program Files (x86)\Meld
  • In SourceTree, go to Tools/Options/Diff
  • In External Diff Tool, choose Custom
  • Enter meld in Diff Command and $LOCAL $REMOTE in Arguments
  • Click Ok and restart SourceTree
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@jewelsea
jewelsea / LabeledProgressBarSample.java
Last active November 19, 2020 10:17
Sample of overlaying a text label indicating progress on top of a JavaFX ProgressBar.
import javafx.animation.*;
import javafx.application.Application;
import javafx.beans.property.*;
import javafx.beans.value.*;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.text.Text;
@andytill
andytill / HierarchyTreeCell.java
Created November 4, 2012 00:44
A JavaFX TreeCell implementation with drag and drop.
package projmon.hierarchical;
import javafx.event.EventHandler;
import javafx.geometry.Point2D;
import javafx.scene.control.TreeCell;
import javafx.scene.control.TreeItem;
import javafx.scene.effect.InnerShadow;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.DragEvent;
import javafx.scene.input.Dragboard;
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@jboner
jboner / latency.txt
Last active April 26, 2024 03:40
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD