Skip to content

Instantly share code, notes, and snippets.

View xenogew's full-sized avatar
😆
Working with motivation

Natta Wang xenogew

😆
Working with motivation
View GitHub Profile
@andrebrait
andrebrait / keychron_linux.md
Last active November 1, 2024 11:01
Keychron keyboards on Linux + Bluetooth fixes

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

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

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 (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@trang1
trang1 / drop-public-synonyms.sql
Created November 7, 2018 10:56
Oracle PL/SQL - How to delete all public synonyms for a schema
BEGIN
FOR cur_syn IN (SELECT synonym_name
FROM all_synonyms
WHERE table_owner = 'somebody')
LOOP
BEGIN
EXECUTE IMMEDIATE 'drop public synonym ' || cur_syn.synonym_name ;
EXCEPTION
WHEN OTHERS
THEN
@kweij
kweij / bootstrap-modal-fix-ios-background-scrolling.js
Created October 1, 2018 12:58
JavaScript-only fix for the background scrolling in Bootstrap modals on iOS (Safari)
let previousScrollY = 0;
$(document).on('show.bs.modal', () => {
previousScrollY = window.scrollY;
$('html').addClass('modal-open').css({
marginTop: -previousScrollY,
overflow: 'hidden',
left: 0,
right: 0,
top: 0,
@winggundamth
winggundamth / docker-compose.yml
Created April 28, 2018 09:01
Elasticsearch Cluster + Grafana Docker Compose File
version: '3'
services:
es1:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
container_name: es1
environment:
cluster.name: "docker-cluster"
bootstrap.memory_lock: "true"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
TAKE_FILE_OWNERSHIP: "true"
@kariae
kariae / .gitlab-ci.yml
Created June 6, 2017 17:29
GitLab CI/CD configuration for Symfony
variables:
REGISTRY_URL: registry.lekode.com:5000
IMAGE_NAME: app
BUILD_CODE_IMAGE: $REGISTRY_URL/$IMAGE_NAME:$CI_COMMIT_REF_NAME
LATEST_CODE_IMAGE: $REGISTRY_URL/$IMAGE_NAME:latest
stages:
- test
- install
- build
@frfahim
frfahim / install virtualenv ubuntu 16.04.md
Last active October 8, 2024 21:35
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@zenorocha
zenorocha / etc-hosts-on-win.md
Last active April 11, 2024 23:07
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

@kazua
kazua / convDate2.php
Created December 26, 2013 15:54
PHPで西暦⇔和暦変換
<?php
//write kazua
function convGtJDate($src) {
list($year, $month, $day) = explode('/', $src);
if (!@checkdate($month, $day, $year) || $year < 1869 || strlen($year) !== 4
|| strlen($month) !== 2 || strlen($day) !== 2) return false;
$date = str_replace('/', '', $src);
if ($date >= 19890108) {
$gengo = '平成';
@josefeg
josefeg / CreditCardNumberGenerator.java
Last active February 27, 2024 17:04
Credit card number generator in Java
import java.util.Random;
/**
* A credit card number generator.
*
* @author Josef Galea
*/
public class CreditCardNumberGenerator {
private Random random = new Random(System.currentTimeMillis());