This file contains hidden or 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 emojis = [ | |
"clapping_fast", | |
"clapping_very_fast", | |
"kami", | |
"saikou", | |
"_waiwai", | |
"tada", | |
"beer-1", | |
"sparkle", | |
"heart", |
This file contains hidden or 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
readonly PLAYLIST_IDS=( | |
"37i9dQZF1DWZeKCadgRdKQ" # Pop Hits 2022 | |
"37i9dQZEVXcWw7uVUBjiBh" # Discover Weekly | |
"37i9dQZF1DWZZbpkxU5t9L" # Weekly Buzz Tokyo | |
"37i9dQZF1DX2sKGHAy2dfC" # Disco Summer | |
) | |
PLAYLIST_ID=${PLAYLIST_IDS[$(($RANDOM % ${#PLAYLIST_IDS[*]}))]} | |
URI="spotify:playlist:$PLAYLIST_ID" | |
/opt/homebrew/bin/spotify play uri $URI |
This file contains hidden or 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 { Context } from 'next' | |
import Head from 'next/head' | |
import * as React from 'react' | |
import { compose, lifecycle, pure, wrapDisplayName } from 'recompose' | |
function withInitialProps<Props>(provider: (context: Context) => object) { | |
return (BaseComponent: React.ComponentType<Props>) => { | |
return class extends React.Component<Props> { | |
public static displayName = wrapDisplayName(BaseComponent, 'withInitialProps') | |
public static async getInitialProps(context: Context) { |
This file contains hidden or 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
on alfred_script(q) | |
tell application "Terminal" | |
activate | |
do script q | |
delay 0.5 | |
quit | |
end tell | |
end alfred_script |
This file contains hidden or 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
object ClassCollector { | |
private val KINDS = setOf(JavaFileObject.Kind.CLASS) | |
private val fileManager: JavaFileManager | |
init { | |
val compiler = ToolProvider.getSystemJavaCompiler() | |
fileManager = compiler.getStandardFileManager(DiagnosticCollector<JavaFileObject>(), null, null) | |
} |
This file contains hidden or 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
package sandbox; | |
import java.time.Duration; | |
import java.util.Optional; | |
import java.util.concurrent.TimeoutException; | |
/** | |
* グローバルなロックを司るコンポーネントです。 | |
*/ | |
public interface LockManager { |
This file contains hidden or 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 existy = value => value !== null && value !== undefined | |
export function resolve (host, relative, params) { | |
const path = `${host}/${relative}` | |
if (params) { | |
return `${path}?${toQueryParams(params)}` | |
} | |
return path | |
} |
This file contains hidden or 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 LINE_SYMBOL_FACTORY = (size) => { | |
let [ w, h ] = [ size / 2, size / 8 ]; | |
return `M ${-w},${-h} L ${w},${-h} ${w},${h} ${-w},${h} Z`; | |
} |
This file contains hidden or 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 d3 from 'd3/d3' | |
import Plottable from './plottable' | |
const findDOMNode = (node, tag) => { | |
tag = tag.toUpperCase() | |
while (node.parentNode) { | |
node = node.parentNode | |
if (node.tagName.toUpperCase().trim() === tag) { | |
return node | |
} |
This file contains hidden or 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
package bootstrap; | |
public final class Bootstrap { | |
public static void main(String[] args) { | |
new TomcatServer("../project/module").boot(8080); | |
} | |
private Bootstrap() {} |
NewerOlder