Skip to content

Instantly share code, notes, and snippets.

View p0rsche's full-sized avatar
🧨
Working from Shelter Coworking

Vladimir Gerasimov p0rsche

🧨
Working from Shelter Coworking
View GitHub Profile
@p0rsche
p0rsche / time.js
Created March 24, 2018 03:17
Get time in format "mm:hh am|pm"
const timeLocale = 'en-GB'
const timeZone = 'UTC'
const time = (new Date()).toLocaleString(timeLocale, { timeZone: timeZone, hour: 'numeric', minute: 'numeric', hour12: true })
// 10:10 am
@p0rsche
p0rsche / immutableES6ArrayHelpers.js
Last active March 24, 2018 03:18
Immutable ES2015 array helpers
export const addToArrayImmutable = (arr, value) => [...arr, value]
export const unshiftArrayImmutable = (arr, value) => [value, ...arr]
export const updateArrayImmutable = (arr, i, value) => Object.assign([...arr], {[i]: value})
export const removeFromArrayImmutable = (arr, value) => arr.filter(i => i !== value)
##########################################
# To run:
# curl -sSL https://gist.githubusercontent.com/andrewelkins/1adc587feb610f586f8f40b50b7efc3a/install-docker-on-linux-mint-18.sh | bash -x
##########################################
# Kernel version http://stackoverflow.com/a/4024263
versionlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
versionlt() {
@p0rsche
p0rsche / gist:bf9f43c4716cff3f1e6ad3e587e829aa
Created January 9, 2018 21:57
getTransformToElement polyfill
SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(toElement) {
return toElement.getScreenCTM().inverse().multiply(this.getScreenCTM());
};
@p0rsche
p0rsche / unifying_pair.c
Created April 11, 2016 08:49
Pairing Logitech Unifying Devices on GNU/Linux
/*
* Copyright 2011 Benjamin Tissoires <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@p0rsche
p0rsche / libsass-install.bash
Last active February 1, 2016 12:17 — forked from edouard-lopez/libsass-install.bash
Installing/Compiling libsass and sassc on Ubuntu 14.04+/Linux Mint 17+ (needed by node-sass)
# Based on https://github.com/sass/libsass/wiki/Building-with-autotools
# Install dependencies
sudo apt-get install automake libtool
# Fetch sources
git clone https://github.com/sass/libsass.git
git clone https://github.com/sass/sassc.git libsass/sassc
# Create configure script
@p0rsche
p0rsche / temporary-email-address-domains
Created January 14, 2016 10:59 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@p0rsche
p0rsche / Gruntfile.js
Last active August 29, 2015 14:25 — forked from jshawl/Gruntfile.js
Grunt + Sass + Autoprefixer
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options:{
style:'compressed'
},
files: {
'css/style.css' : 'scss/style.scss'
@p0rsche
p0rsche / LICENSE.txt
Last active August 29, 2015 14:16 — forked from jed/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass