Skip to content

Instantly share code, notes, and snippets.

dainiuxt /
Created Jun 28, 2022 — forked from andrebrait/
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

View new_object.js
function Player(name, marker) { = name
this.marker = marker
this.sayName = function() {
const player1 = new Player('steve', 'X')
const player2 = new Player('also steve', 'O')
dainiuxt / 1 AWS Cloud9
Created Oct 29, 2020 — forked from yshmarov/0 AWS Cloud9
Ruby on Rails 6: Learn 25+ gems and build a Startup MVP 2020
View 1 AWS Cloud9
# All AWS C9 envments
# Instance management
# Create AWS C9 environment
Setting - set tabs to 2
View slice-splice-arrays.js
/* Free c code camp task
Are there any flaws in my solution (code passes test as OK)?
You are given two arrays and an index.
Use the array methods slice and splice to copy each element of the first array into the second array, in order.
Begin inserting elements at index n of the second array.
Return the resulting array. The input arrays should remain the same after the function runs.
function frankenSplice(arr1, arr2, n) {
View gist:f6680dd662548f4f15ddee85cd9e70b7
sudo smartctl --all /dev/sda
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.10.0-28-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke,
Model Family: Toshiba 2.5" HDD MK..76GSX
Device Model: TOSHIBA MK6476GSX
Serial Number: 22DDPAMST
LU WWN Device Id: 5 000039 3d2786cc0
Firmware Version: GS001C
dainiuxt /
Last active Dec 8, 2017
How to Work with the WordPress Database: 11+ Useful SQL Queries

  1. Change Your WordPress Password

Forgotten your password and locked yourself out of your WordPress site? No worries – you can reset it manually in the database with this SQL query:

UPDATE wp_users SET user_pass = MD5( '[new_password]' ) WHERE user_login = '[username]';

MD5 encrypts the new password so anyone gaining access to the database is not able to read the password.

dainiuxt / functions.php
Created Mar 24, 2017
Add custom code before post content via functions.php
View functions.php
function my_before($content) {
if (is_single()) {
$beforecontent = previous_post_link(); ?> | <?php next_post_link();
$content = $beforecontent . $content;
return $content;
return $content;
add_filter('the_content', 'my_before');
dainiuxt / style.css
Created Mar 23, 2017
Divi portfolio grid view image resize. Just change the padding-top until you get the desired aspect ratio.
View style.css
.et_portfolio_image {
padding-top: 100%;
.et_portfolio_image img {
position: absolute;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
dainiuxt / index.html
Created Mar 22, 2017
The object-fit property defines how an element responds to the height and width of its content box. It's intended for images, videos and other embeddable media formats in conjunction with the object-position property. Used by itself, object-fit lets us crop an inline image by giving us fine-grained control over how it squishes and stretches insi…
View index.html
<div class="original-image">
<p>original image</p>
<img src="">
<div class="image">
<p>object-fit: fill</p>
<img class="object-fit_fill" src="">