Skip to main content
Snippets

탬플릿



Less than 1 minuteJenkinsSnippetsjenkinscicdcicd
Snippets


Less than 1 minuteCITravis CISnippetstravistraviscitravis-cicicdcicd
Snippets

yt-dlp 로 mp3 추출

Prerequisite(s)

  • ffmpeg
  • yt-dlp

아래 스크립트를 실행하여 설치

choco install -y ffmpeg yt-dlp

Less than 1 minuteBatchfileSnippetsbatchbatwindowswindows-terminalmultilineDOSKEY
Snippets

Shimmer

demo
demo
SizedBox(width: 200.0, height:100.0, 
  child: Shimmer.fromColors(
    baseColor: Colors.red,
    highlightColor: Colors.yellow,
    child: Text('Shimmer', 
      textAlign: TextAlign.center,
      style: TextStyle(
        fontSize: 40.0, fontWeight: FontWeight.bold,
      ),
    ),
  ),
)l

Less than 1 minuteDartSnippetsdartflutter
Snippets

Date

private const val TIME_STAMP_FORMAT = "EEEE. MMM d, yyyy - hh:mm:ss a"
private const val DATE_FORMAT = "yyyy-MM-dd"

fun Long.getTimeStamp(): String {
    val date = Date(this)
    val simpleDateFormat = SimpleDateFormat(TIME_STAMP_FORMAT, Locale.getDefault())
    simpleDateFormat.timeZone = TimeZone.getDefault()
    return simpleDateFormat.format(date)
}

fun Long.getYearMonthDay(): String {
    val date = Date(this)
    val simpleDateFormat = SimpleDateFormat(DATE_FORMAT, Locale.getDefault())
    simpleDateFormat.timeZone = TimeZone.getDefault()
    return simpleDateFormat.format(date)
}

@Throws(ParseException::class)
fun String.getDateUnixTime(): Long {
    try {
        val simpleDateFormat = SimpleDateFormat(DATE_FORMAT, Locale.getDefault())
        simpleDateFormat.timeZone = TimeZone.getDefault()
        return simpleDateFormat.parse(this)!!.time
    } catch (e: ParseException) {
        e.printStackTrace(0)
    }
    throw ParseException("Please Enter a valid date", 0)
}

val currentTime = System.currentTimeMillis()
println(currentTime.getTimeStamp()) 
// Sunday, September 20, 2020 - 10:48:26 AM
println(currentTime.getYearMonthDay())
// 2020-09-20
println("2020-09-20".getDateUnixTime())
// 1600549200000

Less than 1 minuteJavaSnippetsjavajdkjdk7jdk8singletonenumjavadocskotlincompanion-object
Gradle Snippets


Less than 1 minuteJavaKotlinSpringGradleSnippetsgradlegroovyspringspringbootideaintellij-ideaintellijplugin-android
Snippets

YouTube

Paste the entire script to the Chrome DevTool (F12) Console

deleteVideoFromWatchLater

  1. move to /playlist?list=WL
  2. Paste the code to the console
function deleteVideoFromWatchLater() {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];
    video.querySelector('#primary button[aria-label="Action menu"]').click();
    var things = document.evaluate(
        '//span[contains(text(),"Remove from")]',
        document,
        null,
        XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
        null
    );
    for (var i = 0; i < things.snapshotLength; i++) {
        things.snapshotItem(i).click();
    }
}

async function deleteWatchLater() {
  // Fiddle with these if you'd like
  let batchSize = 200; // Number to delete at once before waiting
  let waitBetweenBatchesInMilliseconds = 1000 * 60 * 5; // 5 minutes
  let waitBetweenDeletionsInMilliseconds = 1000; // Half a second

  let totalWaitTime = ((5000 / batchSize) * (waitBetweenBatchesInMilliseconds / 1000 / 60)) + (5000 * (waitBetweenDeletionsInMilliseconds / 1000 / 60))
  console.log(`Deletion will take around ${totalWaitTime.toFixed(0)} minutes to run if the playlist is full.`);

  let count = 0;
  while (true) {
    await new Promise(resolve => setTimeout(resolve, waitBetweenDeletionsInMilliseconds));
    deleteVideoFromWatchLater();
    count++;

    if (count % batchSize === 0 && count !== 0) {
      console.log('Waiting for 5 minutes...');
      await new Promise(resolve => setTimeout(waitBetweenBatchesInMilliseconds));
    }
  }
}

deleteWatchLater();

About 2 minJavaScriptSnippetsjsjavascriptsnippets
Snippets

Flowchart

Simple

Live Network Diagram Influxdb Grafana

link


About 3 minNode.jsMermaid.jsSnippetsnodenodejsnode-jsmermaidmermaidjsmermaid-jsexample
Snippets (Serpiko)

react using state when you don't need it


About 6 minReact.jsSnippetsjsnodenodejsreactreactjsreactnativefacebookmetasnippets (Serpiko)
Snippets

A Guided tour in your app with React Joyride


Less than 1 minuteReact.jsSnippetsjsnodenodejsreactreactjsreactnativefacebookmetasnippets