Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@xiaozhuai
xiaozhuai / fix_parallels_tools_install.md
Last active April 16, 2023 09:00
fix parallels tools install issue

install log

cd prl_fs/SharedFolders/Guest/Linux/prl_fs && make CC=cc
make[1]: Entering directory '/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs'
make -C /lib/modules/5.0.0-25-generic/build M=/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs CC=cc
make[2]: Entering directory '/usr/src/linux-headers-5.0.0-25-generic'
  CC [M]  /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.o
/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c: In function 'prlfs_remount':
/usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c:119:21: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'?
  if ( (!((*flags) & MS_RDONLY) && PRLFS_SB(sb)->readonly) ||
// ==UserScript==
// @name Spotify ad skipper
// @version 1.0
// @namespace http://tampermonkey.net/
// @description Detects and skips ads on spotify
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
// @updateURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
@iMartyn
iMartyn / commit-msg
Last active January 20, 2021 14:01
Add Jira ref to commit messages
#!/bin/sh
# Uncomment below if you want the commit messages to start [refs: jira-123] or you'll just get [jira-123]
#PREAMBLE="refs: "
SED=sed
# If you're on mac and you don't have gnu sed installed, heaven help you.
if uname | grep "Darwin" 2>&1 > /dev/null; then
SED=gsed
> Dear ${user.first_name},
Dear sample01

> Dear ${user.password}
FreeMarket template error: the following has evaluated to null or missing...

Q: Is it safe to allow users to upload templates if they are untrusted?

@arobb
arobb / sierra-virtualbox-install.md
Last active November 24, 2020 13:15
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
@michaelficarra
michaelficarra / append-template-tag.js
Created May 30, 2016 14:29
chainable template tag for joining a bunch of strings over many lines
function append(separator) {
return typeof separator === "string" ? appender(separator, "") : appender("", "").apply(this, arguments);
}
function appender(separator, s) {
return function tag(literalParts, ...computedParts) {
s += literalParts[0];
for (let i = 1; i < literalParts.length; ++i) {
s += computedParts[i - 1] + literalParts[i];
}
@paulirish
paulirish / what-forces-layout.md
Last active April 23, 2024 11:02
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
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active March 31, 2024 11:57
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@nhibberd
nhibberd / gist:9d78576aab943cdb0f6c
Created June 23, 2014 00:41
Zsh case insensitivity auto complete
## case-insensitive (uppercase from lowercase) completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
## case-insensitive (all) completion
#zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
## case-insensitive,partial-word and then substring completion
#zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'