Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivan Čurić ivancuric

View GitHub Profile
@ivancuric
ivancuric / no-courier.reg
Last active Apr 27, 2020
Courier => Consolas
View no-courier.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Courier New (TrueType)"=""
"Courier New Bold (TrueType)"=""
"Courier New Bold Italic (TrueType)"=""
"Courier New Italic (TrueType)"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
View _☢️💣.scss
/** Extends sanitize.css */
// input styling
button,
input,
label,
select,
textarea {
display: block;
border-style: none;
View scrollbar-compensate.js
// ==============================================================
// Compensates the scrollbar width on fixed-position elements
// ==============================================================
class ScrollbarCompensate {
constructor() {
this.itemsToCompensate = [
document.querySelector('body'),
document.querySelector('.menu-btn-container'),
];
View yolo.js
(() => {
const sindreList = [
'#alternativefact',
'#alternativefacts',
'@realdonaldtrump',
'attorney general',
'bomb',
'bombs',
'brexit',
'climate change',
View gist:e9abb2e0965145b035ac27fe15bb3f9b
freedom of speech
catholic
muslim
christian
democratic
Fox news
BBC
rightwing
right-wing
right wing
@ivancuric
ivancuric / ios-amp.js
Created Jun 8, 2017
iOS amp double-html hack
View ios-amp.js
import { oneLineTrim } from 'common-tags';
// Create wrapper.
const htmlInner = document.createElement('html');
const htmlOuter = document.documentElement;
htmlInner.id = 'i-html-wrapper';
// Setup classes and styles.
htmlInner.className = htmlOuter.className;
htmlOuter.className = 'iOSfix';
// const height = window.innerHeight;
@ivancuric
ivancuric / preact-lifecycle.js
Created May 23, 2017
Preact lifecycle methods
View preact-lifecycle.js
class Foo extends Component {
shouldComponentUpdate(nextProps, nextState) {
componentWillReceiveProps(nextProps, nextState) {
this.props // previous props
this.state // previous state
}
componentWillMount() {
componentDidMount() {
componentDidUpdate() {
componentWillUnmount() {
@ivancuric
ivancuric / snazzy.json
Last active Apr 26, 2017
Snazzy theme for integrated VSCode terminal. Stuff it in your settings.json
View snazzy.json
"workbench.experimental.colorCustomizations": {
"terminalAnsiBlack": "#282a36",
"terminalAnsiRed": "#ff5c57",
"terminalAnsiGreen": "#5af78e",
"terminalAnsiYellow": "#f3f99d",
"terminalAnsiBlue": "#57c7ff",
"terminalAnsiMagenta": "#ff6ac1",
"terminalAnsiCyan": "#9aedfe",
"terminalAnsiWhite": "#eff0eb",
"terminalAnsiBrightBlack": "#686868",
@ivancuric
ivancuric / refresh-rate.js
Created Mar 27, 2017
Method for finding out the refresh rate of the device
View refresh-rate.js
function _getRefreshRate() {
const rafPromise = _ => new Promise(requestAnimationFrame);
const idlePromise = _ => new Promise(requestIdleCallback);
let f1, f2;
return new Promise(resolve => {
idlePromise()
.then(_ => rafPromise())
.then(frame => {f1 = frame; return rafPromise();})
View settings.json
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Input",
"editor.fontSize": 14,
"terminal.integrated.fontLigatures": true,
"terminal.integrated.fontSize": 14,
"editor.wordWrap": "on",
"editor.minimap.enabled": true,
"editor.minimap.renderCharacters": false,
"editor.fontLigatures": true,
You can’t perform that action at this time.