Skip to content

Instantly share code, notes, and snippets.

@rexpan
rexpan / comment toggle.js
Created May 6, 2013 03:12
comment toggle
//*
someCode();
/*/
someOtherCode();
//*/
@rexpan
rexpan / projecteuler.18.js
Last active September 28, 2017 04:16
Project Euler
"use strict";
let xss =
`75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 34
88 02 77 73 07 63 67
@rexpan
rexpan / react-16.jsx
Last active September 28, 2017 03:29
New Features of React 16
const ComponentDomAttributes = () => (<div some-dom-attr={1}></div>); // html => <div some-dom-attr="1"></div>
const ComponentRenderText = ({ title, text }) => `${title}: ${text}.`;
const ComponentRenderFragments = () => ([
<div>A</div>,
<div>B</div>,
]);
class Overlay extends Component {
constructor(props) {
super(props);
@rexpan
rexpan / typescript-tips.ts
Created September 28, 2017 03:46
Typescript tips
function createInput(type: 'text' , value: string ): HTMLInputElement;
function createInput(type: 'checkbox', value: boolean): HTMLInputElement;
function createInput(type, value) {
// ...
}
@rexpan
rexpan / mystery.knightlab.com.sql
Created December 18, 2019 04:33
mystery.knightlab.com solution
-- https://mystery.knightlab.com/
-- get all tables in database
select name, sql
from sqlite_master t
where t.type = 'table';
--
CREATE TABLE crime_scene_report ( date integer, type text, description text, city text )
CREATE TABLE drivers_license ( id integer PRIMARY KEY, age integer, height integer, eye_color text, hair_color text, gender text, plate_number text, car_make text, car_model text )
CREATE TABLE person ( id integer PRIMARY KEY, name text, license_id integer, address_number integer, address_street_name text, ssn integer, FOREIGN KEY (license_id) REFERENCES drivers_license(id) )

Front-End Performance Checklist 2020

[^1]

Below you'll find an overview of the front-end performance issues you might need to consider to ensure that your response times are fast and smooth.


@rexpan
rexpan / ReadMe.md
Created March 30, 2020 06:08
Baseus Bluetooth Adapter Driver

Baseus Bluetooth Adapter Driver

From offical link (mirror) in the box.

蓝牙适配器4.0驱动电子档.zip
428629596 Bytes
CRC32   A1B55D5B
MD5     FC1BD18762A25C82503C816CF0EA20A9
SHA-1 128257A80F36C55D06B0A54D5FFF73AE8A43BF44
@rexpan
rexpan / README.md
Created April 11, 2023 04:24
Emit events vs Callback Props

Emit events vs Callback Props

Emit events and Callback props will be compiled to the same code

HTMLElement

PlayGround

<button :onClick="increase">prop</button>
event
-- https://github.com/hristo2612/SQLNoir
-- Case #001: The Vanishing Briefcase
-- Set in the gritty 1980s, a valuable briefcase has disappeared from the Blue Note Lounge.
select * from crime_scene where location = 'Blue Note Lounge'
-- id date type description
-- 76 19851120 theft A briefcase containing sensitive documents vanished. A witness reported a man in a trench coat with a scar on his left cheek fleeing the scene.
select * from suspects where attire = 'trench coat' AND scar = 'left cheek'
-- id name
-- 3 Frankie Lombardi