Skip to content

Instantly share code, notes, and snippets.

View adem's full-sized avatar

Adem Aydin adem

  • Freiburg im Breisgau, Germany
View GitHub Profile
@adem
adem / word_frequency.py
Last active August 28, 2021 03:29
Word frequency
import sys
import re
def get_word_frequency(words: list[str]) -> dict[str, int]:
"""
Given a list of words, returns a Dictionary containing the words as keys
and their frequency as values.
>>> words = ["foo", "bar", "foo", "baz", "baz", "baz", "bar"]
>>> result = get_word_frequency(words)
@adem
adem / panopto_dl.py
Created December 16, 2020 11:43 — forked from DavidBuchanan314/panopto_dl.py
Panopto video downloader
import requests
import json
import os
import youtube_dl
PANOPTO_BASE = "https://cardiff.cloud.panopto.eu"
"""
Place the value of your .ASPXAUTH token in the following variable
"""
package scope
import (
"log"
"os"
)
var cwd string
func init() {

Keybase proof

I hereby claim:

  • I am adem on github.
  • I am adem (https://keybase.io/adem) on keybase.
  • I have a public key whose fingerprint is 74BA C833 A187 5F0F FA14 A2BE 2D3C 9B3C 6067 68AF

To claim this, I am signing this object:

@adem
adem / slug.js
Created November 3, 2012 10:31 — forked from bentruyman/slug.js
JavaScript Slug Generator
// Generates a URL-friendly "slug" from a provided string.
// For example: "This Is Great!!!" transforms into "this-is-great"
function generateSlug (value) {
// 1) convert to lowercase
// 2) remove dashes and pluses
// 3) replace spaces with dashes
// 4) remove everything but alphanumeric characters and dashes
return value.toLowerCase().replace(/-+/g, '').replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '');
};
@adem
adem / static_server.js
Created March 31, 2012 12:29 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);