Skip to content

Instantly share code, notes, and snippets.

View ibreathebsb's full-sized avatar

Isaac Young ibreathebsb

View GitHub Profile

SUID

  1. 只对二进制程序有效,对shell脚本或者目录无效
  2. 拥有者的权限执行位改为s
  3. 执行者拥有x权限
  4. 执行者在运行程序过程中将获得改文件拥有者的权限

SGID

// tree node
class TreeNode {
constructor(value) {
this.value = value
this.parent = null
this.left = this.right = null
}
insert(newNode) {
const {
value
@ibreathebsb
ibreathebsb / NumberFlip.ts
Last active June 25, 2018 10:34
NumberFlip
// NumberFlip.ts
import * as React from 'react';
import cStyle from './NumberFlip.scss'
class NumberFlip extends React.Component {
private static Nums = Array.from({ length: 11 }).map((v, i) => i % 10);
private num: number = 0;
private $content: HTMLElement | null;
private $scroller: HTMLElement | null;
private height: number = 0;
@ibreathebsb
ibreathebsb / serviceWorkerUpdate.js
Created April 8, 2018 10:03
serviceWorker update
/**
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ibreathebsb
ibreathebsb / upload.js
Last active May 15, 2025 20:29
file upload from dataUrl with axios
// Note: only for modern browser
import axios from 'axios'
// helper function: generate a new file from base64 String
const dataURLtoFile = (dataurl, filename) => {
const arr = dataurl.split(',')
const mime = arr[0].match(/:(.*?);/)[1]
const bstr = atob(arr[1])
let n = bstr.length
const u8arr = new Uint8Array(n)
@ibreathebsb
ibreathebsb / package.json
Last active November 28, 2018 13:03
webpack 4 config for react
{
"name": "whitealbum.io",
"description": "whitealbum.io",
"version": "1.0.0",
"keywords": [
"blog"
],
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server",