Skip to content

Instantly share code, notes, and snippets.

View LeetCodes's full-sized avatar
🎱
Choppin' caine rain, hail, sleet, or snow

LeetCodes

🎱
Choppin' caine rain, hail, sleet, or snow
View GitHub Profile
@LeetCodes
LeetCodes / irc.js
Created August 27, 2018 03:47 — forked from WebReflection/irc.js
Transform IRC logs into Markdown
#!/usr/bin/env node
require('fs').readFile(process.argv[2], (err, data) => {
if (err) return;
const content = data.toString().trim();
const re = /^\[(.+?)\]\s+<(.+?)>\s(.*)$/gm;
const chat = [];
let current = {};
while (match = re.exec(content)) {
if (match[2] !== current.name) {
@LeetCodes
LeetCodes / rotating.css
Created August 28, 2018 04:00 — forked from krizpoon/rotating.css
Infinite rotation by CSS. Useful for loading spinners.
@keyframes rotating
{
from
{
transform: rotate(0deg);
-o-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
}
@LeetCodes
LeetCodes / criticalcss-bookmarklet-devtool-snippet.js
Created September 2, 2018 05:56 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
<!doctype html>
<head>
<script src="lib/codemirror.js"></script>
<link rel="stylesheet" href="lib/codemirror.css">
<script src="mode/javascript/javascript.js"></script>
<style>
body {
background-color: #eee;
}
W = 490
H = 475
def setup
srand 333
frame_rate 10
end
def draw
if frame_count == 1
@LeetCodes
LeetCodes / markdown-discord.md
Created November 13, 2018 23:47
Discord Markdown Guide

Markdown Discord Text

Give your text a twist using markdown, syntax highlighting, formats in Discord.

Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__

@LeetCodes
LeetCodes / spotify_keybindings
Created December 18, 2018 12:32 — forked from jbonney/spotify_keybindings
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@LeetCodes
LeetCodes / waterfall1.rb
Created January 7, 2019 03:08 — forked from szeryf/waterfall1.rb
Waterfall One, the source of
# Waterfall One
# http://low-sugar-eye-candy.tumblr.com/post/164374908068/waterfall-one
#
# requires jruby_art gem and Processing3 to run
# run with: k9 run --nojruby forest.rb
W = 500
H = 801
def setup
# requires jruby_art gem and Processing3 to run
# run with: k9 run --nojruby forest.rb
def setup
@images = Dir.glob("resized-*.jpg").map { |file| load_image(file) }
@pixels = @images.map { |i| i.load_pixels; i.pixels }
noise_seed 130
end
def draw