Skip to content

Instantly share code, notes, and snippets.

View MohamedKari's full-sized avatar

MohamedKari

View GitHub Profile
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@yusuke024
yusuke024 / ViewController.swift
Created November 16, 2018 03:15
Recording video with AVAssetWriter
import UIKit
import AVFoundation
class ViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
switch AVCaptureDevice.authorizationStatus(for: .video) {
case .notDetermined:
@rotimi-best
rotimi-best / merge.md
Last active November 3, 2023 14:58
How to merge one folder within two branches in git

git - How to merge one folder within two branches

In my project folder I have 2 folders client and server, I only want get the changes in my server folder from master to prod branch

  1. git checkout prod - Go to the branch with the oldest changes
  2. git merge --no-commit --no-ff master - Merge with the branch with the latest changes. Read More
  3. git reset -- client* - Unstage any changes from client folder, I only want to server folder. Read More
  4. git checkout -- client* - Remove any changes from client folder, I only want to server folder.
  5. git clean -n - View all unstaged files. Read More
  6. git clean -fd - Remove all unstaged folder, if you dont want to remove all then you should add those with git add and then run this command. Read More
@vfdev-5
vfdev-5 / README.md
Last active August 14, 2023 11:00
ROS development on MacOSX using docker

ROS development on MacOSX using docker

We need to use docker-machine to handle USB ports inside the docker.

Docker Machine (0.16.1)

@mcguffin
mcguffin / git-release.py
Last active July 6, 2023 04:38
Python script to create GitHub release
#!/usr/bin/env python3
import argparse, glob, json, re, subprocess, urllib.request, os, sys
class version_number:
major=0
minor=0
release=0
@WillWetzel
WillWetzel / Quaternion.cpp
Created October 6, 2018 23:07
Programming for Games - Project 1 - Vectors and Quaternions
/*Name: William Wetzel - 130251255*/
/*Programming for Games - Project 1*/
/*2016*/
/*Quaternion.cpp file. Has all methods declared in the Quaternion header file.*/
#include "Quaternion.h"
Quaternion::Quaternion() {
coord = new float[4];
@redatawfik
redatawfik / server.cpp
Created June 12, 2020 03:52
Server implementation of client-server chat using Winsock
#include <winsock2.h>
#include <iostream>
struct CLIENT_INFO {
SOCKET hClientSocket;
struct sockaddr_in clientAddr;
};
char szServerIPAddr[] = "192.168.1.4"; // Put here the IP address of the server
int nServerPort = 5050; // The server port that will be used by