Skip to content

Instantly share code, notes, and snippets.

View klaasnicolaas's full-sized avatar
🧐
Looking for a job

Klaas Schoute klaasnicolaas

🧐
Looking for a job
View GitHub Profile
@HenryJia
HenryJia / pid_cartpole.py
Last active July 15, 2022 17:34
Solving OpenAI's Cartpole with a very simple PID controller in 35 lines
import numpy as np
import gym
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
env = gym.make('CartPole-v1')
desired_state = np.array([0, 0, 0, 0])
desired_mask = np.array([0, 0, 1, 0])
@bitsurgeon
bitsurgeon / youtube.md
Last active April 15, 2024 16:46
Markdown cheatsheet for YouTube

Embed YouTube Video in Markdown File

  1. Markdown style
[![Watch the video](https://img.youtube.com/vi/nTQUwghvy5Q/default.jpg)](https://youtu.be/nTQUwghvy5Q)
  1. HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">
@zenthangplus
zenthangplus / fix-permission-docker-kill.sh
Created January 15, 2019 04:21
Fix permission denied when execute stop or kill docker containers on Ubuntu
#!/usr/bin/env bash
# Error example:
# ERROR: for redis cannot stop container: 16028f9:
# Cannot kill container 16028f9: unknown error after kill: docker-runc did not terminate sucessfully:
# container_linux.go:393: signaling init process caused "permission denied"
#
# This error was caused by AppArmor service in Ubuntu
# It was not working normally due to some unknown issues.
# Run following commands to fix it.
@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active January 8, 2024 12:33
Installing Python 3.7.4 on Raspbian

Installing Python 3.7.4 on Raspbian =================================

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

@simonhamp
simonhamp / AppServiceProvider.php
Last active March 26, 2024 15:56
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@mikejolley
mikejolley / functions.php
Created April 7, 2017 11:34
WooCommerce 3.0 - Disable deferred email sending
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_defer_transactional_emails', '__return_false' );
@YuMS
YuMS / update-git.sh
Created June 29, 2016 09:28
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y