Skip to content

Instantly share code, notes, and snippets.

View sentientmachine's full-sized avatar
:octocat:
Debugging this simulation.

Eric Leschinski sentientmachine

:octocat:
Debugging this simulation.
View GitHub Profile
@lobstrio
lobstrio / coinmarketcap_extract.py
Last active October 24, 2023 13:26
Extract all cryptocurrencies data from coinmarketcap.com using Python 3 and Request
#!/usr/bin/python3
# coding: utf-8
import requests
from bs4 import BeautifulSoup
from scrapy import Selector
import csv
import datetime
@CodeReclaimers
CodeReclaimers / config
Last active August 24, 2022 04:34
OpenAI Gym LunarLander-v2 writeup
# neat-python configuration for the LunarLander-v2 environment on OpenAI Gym
# Sample run here: https://gym.openai.com/evaluations/eval_FbKq5MxAS9GlvB7W6ioJkg
# NOTE: This was run using revision 1186029827c156e0ff6f9b36d6847eb2aa56757a of CodeReclaimers/neat-python, not a release on PyPI.
[NEAT]
pop_size = 150
# Note: the fitness threshold will never be reached because
# we are controlling the termination ourselves based on simulation performance.
fitness_criterion = max
fitness_threshold = 1000.0
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active July 19, 2024 20:02 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@alejandrofloresm
alejandrofloresm / hello-world.py
Created April 16, 2016 18:16
Hello World for Google
# Code example for:
# Hello World - Machine Learning Recipes #1 - Google Developers
# https://www.youtube.com/watch?v=cKxRvEZd3Mw
from sklearn import tree
# Bumpy = 0, Smooth = 1
features = [[140, 1], [130, 1], [150, 0], [170, 0]]
# Apple = 0, Orange = 1
labels = [0, 0, 1, 1]
@karpathy
karpathy / gist:587454dc0146a6ae21fc
Last active July 11, 2024 10:36
An efficient, batched LSTM.
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@s0enke
s0enke / php_equality_table.php
Created January 3, 2015 12:32
PHP Equality Table
<?php
$values = array(
'true' => true,
'false' => false,
'1' => 1,
'0' => 0,
'-1' => -1,
'"true"' => "true",
'"false"' => "false",
'"1"' => "1",
@ungoldman
ungoldman / curl_post_json.md
Last active September 17, 2024 16:00
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@ccorcos
ccorcos / gist:11197543
Created April 22, 2014 23:10
Python NumPy: pretty print multidimensional ndarray
from pylab import *
from pprint import pprint
def arrayToList(arr):
if type(arr) == type(array([])):
return arrayToList(arr.tolist())
elif type(arr) == type([]):
return [arrayToList(a) for a in arr]
else:
@Jim-Holmstroem
Jim-Holmstroem / numpy_array_hash.py
Created February 21, 2012 10:51
Hash numpy.array
from hashlib import sha1
import numpy
arr=numpy.zeros((256,256,4))
sha1(arr)
import requests
import sys
for i in range(1,10000):
response = requests.post('http://apply.embed.ly/1', data={'answer': str(i)})
if response.status_code == 302:
print i
sys.exit(0)