Skip to content

Instantly share code, notes, and snippets.

@dauuricus
dauuricus / youtube_search.py
Last active October 30, 2022 07:43
youtube search python
# coding: UTF-8
import urllib.request
import urllib.parse
import re
import time
words = "ひろゆき"
keywords = urllib.parse.quote(words)
target = "https://www.youtube.com/results?search_query=" + keywords
video_list_0 = []
@branneman
branneman / http-easy.rkt
Last active June 29, 2024 18:58
Racket: How to do HTTP requests
#lang racket/base
(require
net/http-easy)
(define (base-url path)
(string-append "https://httpbin.org" path))
; request: GET
; response: plain string body
@iani
iani / BresenhamEuclidean_SuperCollider.scd
Last active January 18, 2021 12:28
Bresenham Implementation of the Euclidean Rhythm Algorithm in SuperCollider
/* Sources:
See: https://codepen.io/Dafuseder/pen/WEqOVw
https://gist.github.com/crashingbooth/e9f0b7dbec8aecabf13db3663d28480f
https://medium.com/code-music-noise/euclidean-rhythms-391d879494df
*/
//:Implementation 1 (plain)
(
~br = { | o = 1, p = 4 |
(o / p * (0..p - 1)).floor.differentiate.asInteger.put(0, 1);
};
@korakot
korakot / webapp_port.py
Last active March 16, 2022 08:35
Serve Colab webapp at a port as iframe and window (serve_port)
from google.colab.output import serve_kernel_port_as_iframe, serve_kernel_port_as_window
# start a simple server
get_ipython().system_raw("python3 -m http.server 8888 &")
serve_kernel_port_as_iframe(8888)
# path='/',
# width='100%',
# height='400',
# cache_in_notebook=False
@krithin
krithin / raspberry-pi-install.md
Last active April 4, 2024 22:54
Jitsi Meet Server and Videobridge Installation on Raspberry Pi 4 with Ubuntu Server 21.04

Jitsi Meet install on a Raspberry Pi 4 with Ubuntu Server 21.04

This guide helps you host your own Jitsi server on a Raspberry Pi 4B. It is adapted from Jitsi's quick install guide and the Jitsi on ARM guide written by crouchingtigerhiddenadam. The biggest difference is this is designed to work with a Pi running Ubuntu Server 21.04 instead of Raspbian.

I did this because I'd rather set up Jitsi Meet on a Raspberry Pi I already own than add a dedicated VPS (and pay AWS's bandwidth costs) just for that. I used Ubuntu 21.04 because I'm more familiar with Ubuntu than with Raspbian, and using an arm64 OS makes the setup easier than on armhf. I also tried to use distribution packages instead of manually downloading individual deb files throughout.

Prerequisites

This guide assumes you already have a DNS name set up with an A record pointing

@scy
scy / SuperCollider on Termux.md
Last active December 13, 2021 10:45
My attempt to build SuperCollider on Termux/Android

This was supposed to be posted on the SC forums at scsynth.org, but I ran into the spam filter and thus saved it as a Gist first. It's on the forums now: My attempt to build SuperCollider on Termux/Android

I've been thinking about using SuperCollider on my phone. There's glastonbridge/SuperCollider-Android which hasn't been touched since 2014, so I thought I'll try to build a current version from source, based on the guide for Linux. Also, since Termux provides a great Linux CLI environment, including build toolchains, directly on the device, I wanted to try building SC under Termux.

Spoiler alert: I didn't manage to do it. The main problem is not having an audio driver, since the Linux build requires libjack, and neither Android nor Termux provide it. (Termux has

#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
@smallmake
smallmake / ndl_search_sample.rb
Last active June 5, 2021 15:30
国会図書館検索API利用サンプル
require "faraday"
require 'nokogiri'
class NdlSearch
def get_book_info(title, creator = nil)
data = []
query = {
:mediatype => 1,
:cnt => 10
@korakot
korakot / gophernotes.md
Last active April 27, 2023 06:12
Using Golang kernel in Colab
@verticalgrain
verticalgrain / chip-flashing-guide-nov-2018.md
Last active August 31, 2024 12:51
NextThingCo C.H.I.P. Flashing guide as of November, 2018

Below are the steps required to flash a NextThingCo CHIP or PocketCHIP from the command line, as of November 2018. The web flasher no longer works, and there are numerous errors when flashing from the command line, mostly due to broken dependencies. The following method works for flashing a CHIP as of November 2018:

Note: Flashing must be done on Linux. Tested on Ubuntu and Rasparian. Mac OS seems to not work.

  1. Download and unpack the CHIP-SDK.zip from one of the following:
  1. Download and unpack CHIP-tools.zip from one of the following: