This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Math.round((require('child_process').execSync('wmic /namespace:\\\\root\\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature').toString().split('\r\n')[1].trim()) / 10 - 273) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PayloadAction, configureStore, createSlice } from "@reduxjs/toolkit"; | |
import type { NextPage } from "next"; | |
import { Provider, useDispatch, useSelector } from "react-redux"; | |
import undoable, { StateWithHistory, UndoableOptions } from "redux-undo"; | |
// partial state for a section (undo target) | |
interface NumberState { | |
id: string; | |
title: string; | |
value: number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { NextPage } from "next"; | |
import { useState } from "react"; | |
import { HStack } from "../../src/lib/layout/HStack"; | |
import { VStack } from "../../src/lib/layout/VStack"; | |
import { Button } from "../../src/lib/style/Button"; | |
import { H1 } from "../../src/lib/style/H1"; | |
import { H2 } from "../../src/lib/style/H2"; | |
interface Task { | |
done: boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
createContext, useReducer, useContext, useCallback, | |
} from 'react'; | |
type CounterState = { count: number } | |
type CounterAction = | |
| { type: 'increment'; data: { amount: number } } | |
| { type: 'reset' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var words = twotabsearchtextbox.value.split(" "); | |
[...document.querySelectorAll(".s-result-item")] | |
.filter((v) => !words.every((w) => v.textContent.toLowerCase().includes(w))) | |
.forEach((v) => v.style.opacity = "0.3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = express(); | |
const _use = app.use; | |
let numUseCalls = 0; | |
app.use = function(...args) { | |
const fn = args[args.length - 1]; | |
// except `express.static()` | |
if (fn && fn.name === 'serveStatic') { | |
_use.apply(this, args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// About API: | |
// https://www.dropbox.com/developers/core/docs#oa2-authorize | |
// https://www.dropbox.com/developers/core/docs#oa2-token | |
var config = require('./config.json'); | |
// OR... | |
// var config = { | |
// 'appKey': 'xxxxxxxxxxxxxxx', | |
// 'secretKey': 'xxxxxxxxxxxxxxx' | |
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ./Gruntfile.js | |
module.exports = function(grunt) { | |
grunt.loadTasks('hoge'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
((document, limit) => { | |
const data = Array.from(document.querySelectorAll('*')) | |
.map((el) => ({zIndex: Number(getComputedStyle(el).zIndex), element: el })) | |
.filter(({ zIndex }) => !isNaN(zIndex)) | |
.sort((r1, r2) => r2.zIndex - r1.zIndex) | |
.slice(0, limit); | |
console.table(data); | |
})(document, 50); |
NewerOlder