Skip to content

Instantly share code, notes, and snippets.

kevinxw / state_based_entity_control.yaml
Last active Aug 4, 2021
State based Entity Control
View state_based_entity_control.yaml
name: State Based Entity Control
description: Change the target entity to desired entity state base on the trigger entity's state, illuminance sensor's state, Sun elevation and so on.
domain: automation
name: Trigger Entity
description: This entity will trigger the automation.
kevinxw /
Last active Jul 11, 2021
Google+ Pinterest for the new UI
// ==UserScript==
// @name Google+ Pinterest for the New UI
// @version 0.9
// @id google_plus_ui_sucks_pinterest_pokerface
// @namespace
// @downloadURL
// @updateURL
// @run-at document-end
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
kevinxw / ddns-start
Last active Jun 28, 2021
View ddns-start
# register a subdomain at to get your token
# put 'hostname|token' in the 'Host Name' field under DDNS
# e.g. myhost|abcdefgh-1234-5678-9876-f71b0ed7a7fe
DDNS_HOSTNAME_FIELD=$(nvram get ddns_hostname_x)
SUBDOMAIN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $1}')
TOKEN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $2}')
IPV4=$(nvram get wan0_ipaddr)
kevinxw / The Technical Interview Cheat
Created May 24, 2017 — forked from TSiege/The Technical Interview Cheat
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
// ==UserScript==
// @name Straight Google
// @id straight_google_pokerface
// @version 1.17.13
// @author Pokerface - Kevin
// @namespace
// @description Remove URL redirection from google products
// @license GPL v3 or later version
// @downloadURL
// @updateURL
kevinxw /
Created Aug 30, 2016 — forked from the-darkvoid/
AsusWRT Merlin: Isolate Guest WiFi
kevinxw /
Created Jun 25, 2019
seafile-sqlite to mysql
echo "Dropping database.."
mysql -e 'drop database if exists `seafile-ccnet`;'
mysql -e 'drop database if exists `seafile-main`;'
mysql -e 'drop database if exists `seafile-seahub`;'
echo 'Recreating ccnet database..'
mysql -e 'create database `seafile-ccnet` character set = "utf8";'
mysql 'seafile-ccnet' < seafile-server-latest/sql/mysql/ccnet.sql
echo 'Recreating seafile database..'
kevinxw / Crypto-lab6-digt.c
Last active Oct 12, 2018
CIS 644 Lab 6 Hash function crack
View Crypto-lab6-digt.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/evp.h>
void getHash(char * hashname, char *msg, unsigned char *md_value) {
EVP_MD_CTX *mdctx;
const EVP_MD *md;
//unsigned char md_value[EVP_MAX_MD_SIZE];
int md_len, i;
kevinxw /
Created Nov 9, 2017 — forked from vincent-zurczak/
A Maven mojo that shows how to resolve dependencies locations, be it in remote or in the local repository, or even in the reactor.
package whatever;
import java.util.ArrayList;
import java.util.HashSet;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;