Skip to content

Instantly share code, notes, and snippets.

View AhmadMoussa's full-sized avatar
🔮
Hello, is this Turing?

Ahmad Moussa AhmadMoussa

🔮
Hello, is this Turing?
View GitHub Profile

PostSpectacular Manifesto

Literacy

  • Learn by doing
    • Take away a sound understanding of new concepts learned at the end of each activity
    • Transform knowledge into intuition
    • Share your learnings
    • Experiment to avoid/overcome procrastination
  • Go further, Carpe noctem
@nsbalbi
nsbalbi / donut.pde
Last active July 11, 2022 19:56
Universe in a Donut
// Processing Code By Nicholas Sbalbi (@nsbalbi)
// Twitter post: https://twitter.com/nsbalbi/status/1406696979523047437
// Github gist: https://gist.github.com/nsbalbi/7c09f0101f90c45ecc391e7f64b29c10
// 6-22-2021
// Motion blur via @beesandbombs and inspiration from @etiennejcb
/*
Copyright (c) 2021 Nicholas Sbalbi
Permission is hereby granted, free of charge, to any person obtaining a copy
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@dreizehnutters
dreizehnutters / p5_scrapper.py
Last active November 5, 2021 13:46
p5.js webeditor scrapper
"""
what:
download all sketches (as .zip) from a given user on p5.js
how:
python <TARGET> [<OUT_DIR>]
who:
@13utters
"""
from sys import argv, exit
from pathlib import Path
@ialhashim
ialhashim / Upsample.py
Last active October 19, 2020 14:48
Resize or interpolate tensors to any spatial dimension in Keras
import tensorflow as tf
import keras.backend as K
from keras.layers import Lambda
#
# Keras + TensorFlow
# Resize 'tensorA' to be of the same size as 'tensorB' using 'tf.image.resize_bilinear'
# Very useful for skip-connections and 'Concatenate' layers that might complain about being off by one column
# Only works when dimensions are provided since we use ' K.int_shape' that returns the static shape
#
@primaryobjects
primaryobjects / m3u8.md
Last active April 15, 2024 15:19
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@jesseengel
jesseengel / rainbowgram.py
Created September 5, 2017 17:10
Script to plot "rainbowgrams" from NSynth (https://arxiv.org/abs/1704.01279)
import os
import librosa
import matplotlib
import matplotlib.pyplot as plt
matplotlib.rcParams['svg.fonttype'] = 'none'
import numpy as np
from scipy.io.wavfile import read as readwav
# Constants
@naotokui
naotokui / GAN-808_keras.ipynb
Created July 14, 2017 10:17
GAN-based drumloop generation (work in progress)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sylvainpelissier
sylvainpelissier / pyuac.py
Last active March 20, 2023 23:28 — forked from Preston-Landers/pyuac.py
pyuac - elevate a Python process with UAC on Windows compatible Python 3.
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""User Access Control for Microsoft Windows Vista and higher. This is
only for the Windows platform.
This will relaunch either the current script - with all the same command
line parameters - or else you can provide a different script/program to
run. If the current user doesn't normally have admin rights, he'll be
@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)