Skip to content

Instantly share code, notes, and snippets.

View naxoc's full-sized avatar

Camilla Krag Jensen naxoc

View GitHub Profile

Kubuntu 18.04 on Dell XPS 13"

  • Install with Encrypted LVM

Fix Sleep

sudo apt-get install sysfsutils
sudo echo 'power/mem_sleep = deep' > /etc/sysfs.d/mem_sleep.conf
@SkyBehind
SkyBehind / libinput-gestures.conf
Created September 6, 2018 19:06
My libinput config for multi-touch gestures (using Linux on Mac). I use 3-finger side swipe for forward and back, 3-finger up/down for showing all windows, and 4-finger up/down to switch desktops.
# Configuration file for libinput-gestures.
#
# The default configuration file exists at /etc/libinput-gestures.conf
# but a user can create a personal custom configuration file at
# ~/.config/libinput-gestures.conf.
#
# Lines starting with '#' and blank lines are ignored. Currently
# "gesture" and "device" configuration keywords are supported as
# described below. The keyword can optionally be appended with a ":" (to
# maintain compatibility with original format configuration files).
@greigdp
greigdp / xps-9370.md
Created February 3, 2018 22:27
Dell XPS 13 (9370) Archlinux Install Notes

Install Notes - Dell XPS 13 (9370) 2018

The laptop works well on Archlinux. A few notes based on the installation guide for the previous version.

Intel GPU Power Saving

Per the Arch wiki, more power can be saved by creating /etc/modprobe.d/i915.confwith the following content:

options i915 modeset=1 enable_rc6=1 enable_fbc=1 enable_guc_loading=1 enable_guc_submission=1 enable_psr=1
@iperdomo
iperdomo / commit-msg
Last active February 25, 2019 11:42
Simple Git commit hook to enforce adding an issue number
#!/bin/sh
if [[ -z "$(head -n1 "$1" | grep -o -E '#[0-9]+')" ]]; then
echo >&2 ERROR: Commit message must include issue number.
exit 1
fi
exit 0
@Warry
Warry / Article.md
Created December 11, 2012 00:11
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@erikzaadi
erikzaadi / unwatching_organization.js
Created October 29, 2012 14:24
Unsubscribing to an entire organization at once
var auth_token = $("input[name='authenticity_token']")[0].value;
$("a.repo-name[href^='/THEORG']").each(function($elem){
$.post("/notifications/subscribe", {
authenticity_token : auth_token,
do : 'included',
'repository_id' : $("form.js-unsubscribe-form #repository_id", $(this).parent("li")).val()
});
});
@crittermike
crittermike / gist:3503791
Last active February 2, 2019 20:11
Import gzipped MySQL DB dump but ignore data from specific tables
# REGULAR VERSION
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | mysql -u root -p databasename
# DRUPAL VERSION
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | drush sqlc
@bobspace
bobspace / css_colors.js
Last active April 24, 2024 13:34
All of the CSS Color names in a big javascript object.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript object containing all of the color names listed in the CSS Spec.
// This used to be a big array, but the hex values are useful too, so now it's an object.
// If you need the names as an array use Object.keys, but you already knew that!
//
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"