Skip to content

Instantly share code, notes, and snippets.

View pieplu's full-sized avatar

Alexis Piéplu pieplu

View GitHub Profile
@luukvbaal
luukvbaal / cacheremove.hook
Last active February 20, 2024 01:52
yay paccache hooks
[Trigger]
Operation = Remove
Type = Package
Target = *
[Action]
Description = Clearing cache...
When = PostTransaction
Exec = /home/<user>/.local/bin/tools/removehook
@busypeoples
busypeoples / FlowTutorial.js
Last active July 17, 2023 10:12
Flow Fundamentals For JavaScript Developers
//
// MIT License
//
// Copyright (c) 2018 Ali Sharif
//
// 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
@jak
jak / fedora.md
Last active August 4, 2019 21:09 — forked from jpuskar/fedora.md
Installing Fedora 26 on Macbook Pro Retina 2016

Installing Fedora on Macbook Pro retina

  1. Download Fedora 26 iso, create a usb bootable media
  2. Use diskutil list to figure out which drive is the usb, on macbook pro with 1 hardrive, the usb is /dev/disk2
  3. Umount the disk using diskutil unmountDisk /dev/disk2 or use Mac's Disk Utility (just umount, don't eject, umount removes it from directory structure and eject disconncet it altogether)
  4. Use dd(a low level cp) to write iso content into the usb drive, sudo dd if=~/Downloads/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/rdisk2 bs=8m, this will take a bit of time, make sure you wait until it's done, additionally compare the size or checksum to make sure all has been copied (not that necessary since if it weren't copied, it'll err at boot time)
  5. Use Disk Utility to shrink Mac's harddrive to create partition for the subsequent fedora installation
  6. Boot to recovery mode (cmd+r) and disable SIP (termina

The error handling for async/await with try/catch always bugs me. Go to the rescue?

function to(promise) {
  return promise
    .then(res => [null, data])
    .catch(err => [err])
}

async function doIt() {
@mariosant
mariosant / deploy.sh
Last active May 5, 2017 02:05
Use lftp to deploy Grav websites
#! /bin/bash
./bin/grav clear-cache
lftp -c "open \
-u $FTP_USER,$FTP_PASSWORD $DEST_DOMAIN; \
set ftp:ssl-allow off; \
mirror -R ${HOME}/workspace/ $DEST_DIR \
--exclude .git/ --exclude .c9/ --exclude backup/ \
--delete"
@paulirish
paulirish / what-forces-layout.md
Last active June 15, 2024 19:14
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@cmbaughman
cmbaughman / vagrant-win-howto.md
Last active September 7, 2018 09:15
Vagrant >=1.6 Windows Instructions

How to set up a Windows VM with Vagrant

Create your VM

==================

  1. Obtain a windows vm from Modern IE.
  • Win 8 OSX
curl -O -L "https://www.modern.ie/vmdownload?platform=mac&virtPlatform=virtualbox&browserOS=IE10-Win8.1&parts=5&filename=VMBuild_20131127/VirtualBox/IE10_Win8/Mac/IE10.Win8.For.MacVirtualBox.part{1.sfx,2.rar,3.rar,4.rar,5.rar}"
@madeingnecca
madeingnecca / gist:9f7bcabc00dd2b1d91e7
Last active March 11, 2016 10:01
LIFERAY VELOCITY utils
## Print article date with a localized format.
##############################################
#set ($localeDefault = $localeUtil.getDefault())
## Convert string (with a particular input format) to a Date object.
#set ($modifiedDate = $dateTool.toDate("EEE, dd MMM yyyy hh:mm:ss Z", $reserved-article-display-date.getData(), $localeDefault))
## Get the localized format as a string.
#set ($dateFormat = "#language ('custom-medium-dateformat-pattern')")
$dateTool.format($dateFormat, $modifiedDate)
@max
max / gist:5708466
Created June 4, 2013 18:54
Flat UI Colors as Sass variables
// I needed flatuicolors.com as Sass variables...
// In your console, run:
$('.color').get().map(function(el) { return "$" + el.classList[1] + ": " + el.getAttribute('data-clipboard-text') + ';' }).join('\r\n');
// Output:
// $turquoise: #1abc9c;
// $emerland: #2ecc71;
// $peter-river: #3498db;
// $amethyst: #9b59b6;
// $wet-asphalt: #34495e;