Skip to content

Instantly share code, notes, and snippets.

View shinyzhu's full-sized avatar
🗣️
Talk to me

Shiny shinyzhu

🗣️
Talk to me
View GitHub Profile
@shinyzhu
shinyzhu / 01-introduction.md
Created April 23, 2024 07:44 — forked from CliffordAnderson/01-introduction.md
Exploring the U-Bahn with Neo4j

Analyzing the U-Bahn Network with Neo4J

The goal of this exercise is to extract information about the Berlin metro system from Wikidata and to analyze its relationships with Neo4j.

Berlin U-Bahn Map

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>专注力训练:数数</title>
<style type="text/css">
h1{border-bottom: 1px solid #cccccc;}
div#options{margin:0 0 1em 0;background: #efefef; padding: .3em;text-align: center;}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: zhuxl
"""
import os
import re
import csv
@shinyzhu
shinyzhu / Loop-Live-Streaming-with-ffmpeg.md
Last active December 18, 2022 03:55
Live streaming forever with ffmpeg

Loop Live Streaming with ffmpeg

Run ffmpeg in a separate screen.

screen -S stream

Then run the streaming script.

@shinyzhu
shinyzhu / create-redis-cluster.sh
Last active March 3, 2019 03:13 — forked from abhirockzz/create-redis-cluster.sh
Use redis-cli to create a Redis Cluster on Docker (with Redis 5.0)
#------------ bootstrap the cluster nodes --------------------
redis_image='redis:5'
network_name='host' # must be in host mode
#---------- create the cluster ------------------------
for port in `seq 6379 6384`; do \
start_cmd="redis-server --port $port --cluster-enabled yes --cluster-config-file nodes.conf --cluster-node-timeout 5000 --appendonly yes"
docker run -d --name "redis-"$port -p $port:6379 --net $network_name $redis_image $start_cmd;
{"sig":"eccca68f69ef8a88f3fa02319163a7fb5b07445436da80bd4889a58ce8d913307551ff641578186ea46367ea4eedb1852b594029d175b891c0f2b49d57cf3af81","msghash":"85b33d53d100354f8b1c9d587f5cef58eee18f2b2483c9e65a5dad0e470c3e91"}
@shinyzhu
shinyzhu / add-progressbar.vbs
Created May 18, 2014 01:37
Add a progress bar to each slide bottom of PowerPoint.
Option Explicit
Sub AddProgressBar()
On Error Resume Next
With ActivePresentation
For X = 1 To .Slides.Count
.Slides(X).Shapes("PB").Delete
Set s = .Slides(X).Shapes.AddShape(msoShapeRectangle, _
@shinyzhu
shinyzhu / ppt-watermarks-removal.vbs
Last active August 29, 2015 14:01
Remove some watermarks in Powerpoint template files
Option Explicit
Sub RemoveWatermarks()
'image watermark values
Dim imgWidth As Double, imgHeight As Double, delta As Double
imgWidth = 100.12
imgHeight = 100.12
delta = 0.1
@shinyzhu
shinyzhu / GooglePoints.cs
Last active February 7, 2024 12:13
Encode/Decode Polyline Algorithm Format in C#
/// <summary>
/// See https://developers.google.com/maps/documentation/utilities/polylinealgorithm
/// </summary>
public static class GooglePoints
{
/// <summary>
/// Decode google style polyline coordinates.
/// </summary>
/// <param name="encodedPoints"></param>
/// <returns></returns>
var z="http://gist.github.com/",y=document.write,x=$("body"),w=$("p.gist").map(function(b,a){a=$(a);var c=$("a",a),u=c.attr("href");if(c.length&&u.indexOf(z)==0)return{p:a,id:u.substring(z.length)}}).get(),v=function(){if(w.length==0)document.write=y;else{var b=w.shift();document.write=function(){document.write=function(a){b.p.replaceWith(a);v()}};x.append('<scr'+'ipt src="'+z+b.id+'.js"></scr'+'ipt>')}};v();