Skip to content

Instantly share code, notes, and snippets.

@jgthms
jgthms / apple-shadow.css
Created March 12, 2018 20:28
Apple shadow
.apple {
box-shadow: 0 37.125px 70px -12.125px rgba(0,0,0,0.3);
}
@jgthms
jgthms / srt.tcl
Created December 27, 2017 09:16 — forked from antirez/srt.tcl
stretch / sync an SRT subtitle file to exactly match your video file.
# Quick hack to stretch the .srt subtitles to match the one of your video.
# Check the time of the first and last sentence in your video file, then
# use this tool to convert the .srt file into one matching your video with:
#
# tclsh srt.tcl file.srt <your start time> <your end time> > output.srt
#
# Example:
#
# tclsh srt.tcl my.srt 00:00:24,000 00:44:15,000 > ~/Desktop/new.srt
#
@jgthms
jgthms / js-fiddle-hljs.css
Created December 20, 2017 20:43
JSFiddle syntax highlighting colors for highlight js (hljs)
.hljs {
display: block;
overflow-x: auto;
color: #000;
background-color: transparent;
padding: 0;
margin: 0;
-webkit-text-size-adjust: none;
}
@jgthms
jgthms / clickdrag.swift
Created December 7, 2017 11:25
Click drag mouse to specific position and dimension via command line in Mac OS
#!/usr/bin/env xcrun swift
import Foundation
let firstDelayUSec : useconds_t = 2000_000
let kDelayUSec : useconds_t = 500_000
func DragMouse(from p0: CGPoint, to p1: CGPoint) {
let mouseDown = CGEvent.init(mouseEventSource:nil, mouseType:.leftMouseDown, mouseCursorPosition:p0, mouseButton:.left)!
let mouseDrag = CGEvent.init(mouseEventSource:nil, mouseType:.leftMouseDragged, mouseCursorPosition:p1, mouseButton:.left)!
let mouseUp = CGEvent.init(mouseEventSource:nil, mouseType:.leftMouseUp, mouseCursorPosition:p1, mouseButton:.left)!
:root {
--sizeBody: 16px; /* 1rem = 16px */
--navHeight: 4rem; /* 4 * 16px = 64px */
}
.nav {
height: var(--navHeight);
}
@media (min-width: 1000px) {
background-color: #21D4FD;
background-image: linear-gradient(135deg, #21D4FD 0%, #B721FF 50%, #ff8787 100%);
@jgthms
jgthms / mo.js
Created November 27, 2016 16:48
const shiftCurve = mojs.easing.path( 'M0,100 C50,100 50,100 50,50 C50,0 50,0 100,0' );
const scaleCurveBase = mojs.easing.path( 'M0,100 C21.3776817,95.8051376 50,77.3262711 50,-700 C50,80.1708527 76.6222458,93.9449005 100,100' );
const scaleCurve = (p) => { return 1 + scaleCurveBase(p); };
const nScaleCurve = (p) => { return 1 - scaleCurveBase(p)/10; };
const circle = new mojs.Shape({
shape: 'rect',
fill: { '#F64040' : '#F64040', curve: scaleCurve },
radius: 10,
rx: 3,
@jgthms
jgthms / atv.css
Created October 4, 2016 15:28
atv
.atvImg {
border-radius: 5px;
transform-style: preserve-3d;
-webkit-tap-highlight-color: rgba(#000,0);
}
.atvImg img {
border-radius: 5px;
box-shadow: 0 2px 8px rgba(14,21,47,0.25);
}
@jgthms
jgthms / mini-reset.css
Created August 23, 2016 21:56
Mini CSS Reset
/* Blocks */
html,
body,
p,
ol,
ul,
li,
dl,
dt,
dd,
@jgthms
jgthms / breaking-news.css
Created July 14, 2016 20:41
Pitchfork Breaking News Gradient
.breaking-news.tickets {
background: #00c596;
background: linear-gradient(to right,#00c596 0,#009dcd 100%);
}