MATCH (n:VideoTranscript {path:"/Users/ikwattro/dev/_transcript/Intro to Graph Databases Episode #6 - Continuing with Cypher-Kv_HP6C2qes.en.vtt"})-[:HAS_ANNOTATED_TEXT]->(a)
match (a)-[:CONTAINS_SENTENCE]->(s:Sentence)
with a, count(*) as nSentences
match (a)-[:CONTAINS_SENTENCE]->(s:Sentence)-[:HAS_TAG]->(t:Tag)
with a, s, count(distinct t) as nTags, (CASE WHEN nSentences*0.1 > 10 THEN 10 ELSE toInteger(nSentences*0.1) END) as nLimit
where nTags > 4
with a, s, nLimit
order by s.summaryRank
with a, collect({text: s.text, pos: s.sentenceNumber})[..10] as summary
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
// YouTube API video uploader using JavaScript/Node.js | |
// You can find the full visual guide at: https://www.youtube.com/watch?v=gncPwSEzq1s | |
// You can find the brief written guide at: https://quanticdev.com/articles/automating-my-youtube-uploads-using-nodejs | |
// | |
// Upload code is adapted from: https://developers.google.com/youtube/v3/quickstart/nodejs | |
const fs = require('fs'); | |
const readline = require('readline'); | |
const assert = require('assert') | |
const {google} = require('googleapis'); |
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
// ==UserScript== | |
// @name SS.com improver | |
// @description Makes ss.com bearable | |
// @match *://ss.com/* | |
// @match *://*.ss.com/* | |
// @match *://ss.lv/* | |
// @match *://*.ss.lv/* | |
// ==/UserScript== | |
function deleteElem(elem) { |
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
NPROC=$(getconf _NPROCESSORS_ONLN) | |
mkdir -p /usr/src/php/ext | |
cd /usr/src/php/ext | |
pecl bundle redis | |
docker-php-ext-configure redis --enable-redis-igbinary --enable-redis-lzf | |
docker-php-ext-install -j${NPROC} redis | |
cd - |
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
#/usr/bin/bash | |
# strings to look for in our file | |
# Note: you could just parse the whole file. But if you put in a bad password your IP | |
# could end up on the bad guy list | |
declare -a badstrings=("Failed password for invalid user" | |
"input_userauth_request: invalid user" | |
"pam_unix(sshd:auth): check pass; user unknown" | |
"input_userauth_request: invalid user" | |
"does not map back to the address" | |
"pam_unix(sshd:auth): authentication failure" |
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
<# | |
To enable Hyper-V: | |
Enable-HyperV.ps1 $True | |
To disable Hyper-V: | |
Enable-HyperV.ps1 $False | |
Author: Michele Locati <[email protected]> | |
License: MIT | |
Source: https://gist.github.com/mlocati/bb146577785511b44412e2fb57f969a6 | |
#> |
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
// preload css in wordpress | |
// add this code in child theme function.php | |
add_filter( 'style_loader_tag', 'preload_css', 10, 2 ); | |
function preload_css( $html, $handle ){ | |
$targetHanlde = array('zuhaus_mikado_child_style'); | |
if( in_array( $handle, $targetHanlde ) ){ |
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
/** | |
* Copyright 2019 Google LLC. | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
function getEnvironment() { | |
var environment = { | |
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>", | |
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>" | |
}; |
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
version: "3.7" | |
x-logging-elk: &logging-elk | |
# driver: json-file | |
driver: gelf | |
options: | |
gelf-address: udp://172.16.0.38:12201 | |
labels: container_group | |
x-sentry-environment: &sentry-environment |
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
FROM alpine:3.8 | |
# Alpine comes with built in cron schedules | |
# min hour day month weekday command | |
# */15 * * * * run-parts /etc/periodic/15min | |
# 0 * * * * run-parts /etc/periodic/hourly | |
# 0 2 * * * run-parts /etc/periodic/daily | |
# 0 3 * * 6 run-parts /etc/periodic/weekly | |
# 0 5 1 * * run-parts /etc/periodic/monthly |
NewerOlder