Skip to content

Instantly share code, notes, and snippets.

View CrudeImgurApi.py
'''
Created on Nov 2, 2018
@author: nope
'''
import time
import json
import os
CLIENT_ID = os.environ.get('IMGUR_API_KEY', None)
View segfault_stripe.py
#!/usr/bin/env python3
from keras.layers import Input, LeakyReLU, Conv2D
from keras.engine import InputSpec, Layer
from keras.models import Model as KerasModel
import keras.backend as K
import numpy as np
if K.backend() == "plaidml.keras.backend":
import plaidml
import plaidml.op
View TF_to_K_functions.md

// TODO: add all tf functions // TODO: sort by name

// For those cases a TILE impl isn't possible/useful base class to use CPU operations

class CPU_operation(ptile.Operation):
    def __init__(self, inputs, outputs, name=None, side_effects=None):
        self._inputs = inputs
        super(CPU_operation, self).__init__(None, [], outputs, name=name, side_effects=side_effects)
View cpu_features.py
'''
Crude script to analyze which CPU features are used by a given executable/library.
Created on Jun 2, 2019
@author: SleepProgger
'''
import json
import argparse
import sys
View proton_run
#!/bin/sh
if [ -z "$STEAMDIR" ]; then
STEAMDIR="$HOME/.steam/steam/steamapps"
fi
if [ -z "$PROTON_VERSION" ]; then
PROTON_VERSION="Proton 3.16"
fi
@SleepProgger
SleepProgger / video2gif_debug.bat
Last active Sep 29, 2018
video2gif_debug.bat
View video2gif_debug.bat
@ECHO OFF
REM For general infos see http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
REM Set the path here if your ffmpeg executable is somewhere else as in the current directory
SET ffmpeg_path=ffmpeg.exe
SET palette=%TMP%\palette.png
SET subtitlefile=subtitle.ass
if not exist "%ffmpeg_path%" echo "Can't find ffmpeg.exe" & goto done
View video2gif.bat
@ECHO OFF
REM For general infos see http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
REM Set the path here if your ffmpeg executable is somewhere else as in the current directory
SET ffmpeg_path=ffmpeg.exe
SET palette=%TMP%\palette.png
SET subtitlefile=subtitle.ass
if not exist "%ffmpeg_path%" echo "Can't find ffmpeg.exe" & goto done
@SleepProgger
SleepProgger / Python_timer_context manager.py
Last active Jun 9, 2017
because i am too lazy to write it everytime again
View Python_timer_context manager.py
from time import time as now, sleep
class Timer:
def __init__(self, msg=None, times=1):
self.times = times
self.msg = msg
def __enter__(self):
self.start = now()
return self
View run_ideepcolor.py
#!/bin/sh
#
# Run this script from the location of ideepcolor.py
#
# TODO: search for any py 3 version
PYTHON="python3"
CAFFE_FILES="./caffe_files"
MODELS="./models"