Skip to content

Instantly share code, notes, and snippets.

View kikohs's full-sized avatar
😀

Kirell Benzi kikohs

😀
View GitHub Profile
@kikohs
kikohs / ranking.py
Last active August 29, 2015 14:14 — forked from fabianp/ranking.py
"""
Implementation of pairwise ranking using scikit-learn LinearSVC
Reference: "Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich,
T. Graepel, K. Obermayer.
Authors: Fabian Pedregosa <fabian@fseoane.net>
Alexandre Gramfort <alexandre.gramfort@inria.fr>
"""
@kikohs
kikohs / create_video.py
Created April 13, 2016 19:05 — forked from jbilcke/create_video.py
How to create a video using Gephi + Scripting plugin + ffmpeg
execfile("/your/path/to/videomaker.py")
videomaker(
ts_min=1352261778000, # "from" timestamp..
ts_max=1352262378000, # .."to" timestamp
frames=20, # number of images in the video. eg 200 frames for a video at 20 frames per seconds = 10 seconds of video
output_prefix="/path/to/output/dir/frame_", # path where to write the png. images will be prefixed with "frame_"
output_format=".png" # you probably want to leave png here
)
@kikohs
kikohs / tst.py
Last active April 5, 2018 14:25 — forked from anonymous/tst.py
"""Running code with jupyter_client and saving outputs"""
# LICENSE: CC-0 (public domain)
from binascii import a2b_base64
from jupyter_client.manager import start_new_kernel
def handle_output(msg):
msg_type = msg['header']['msg_type']
@kikohs
kikohs / .block
Created October 9, 2019 11:47 — forked from mbostock/.block
Save SVG as PNG
license: gpl-3.0
@kikohs
kikohs / youtube-dl-dash.bash
Created March 24, 2021 18:00 — forked from strayer/youtube-dl-dash.bash
youtube-dl wrapper script to download DASH Video and Audio and combine it with ffmpeg with automatic best format detection and fallback to default youtube-dl behaviour for videos without DASH
#!/usr/bin/env bash
set -e
YOUTUBE_FORMATS=$(youtube-dl -F "$1")
if [[ "$YOUTUBE_FORMATS" == *"(DASH Video)"* ]]; then
VIDEO_NAME=$(youtube-dl --get-filename "$1")
VIDEO_NAME_TMP="$VIDEO_NAME.tmp"
echo "Filename: $VIDEO_NAME"
@kikohs
kikohs / fix-connection-speed-linux-wls2.md
Created December 10, 2021 16:17 — forked from Kavignon/fix-connection-speed-linux-wls2.md
Resolving a slow Wi-Fi connection speed over Linux WSL2

This could be a problem cause by your Windows OS being a bottleneck and limit your speed. After some talks and discussion with a colleague, this is the solution that worked for my case!

From Windows

  • Go to your Start Menu.
  • Go to 'View Network Connections'.
  • Right-click on your Wi-Fi adapter.
  • Select the 'Properties' menu option.
  • Find the 'Internet Protocol Version 4' and select the 'Properties' menu option. (keep the IPv4 option checked)
  • Click on the 'Advanced' button.
  • Uncheck 'Automatic Metric' and enter 1 in the 'Interface metric' text box.