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
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active August 6, 2025 13:42 — 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 December 1, 2025 14:07
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 27, 2025 22:22
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)
@reyjrar
reyjrar / New-iTerm-Window.scpt
Created February 8, 2012 13:14
AppleScript to Open a New iTerm Window and bring it to the front
(*
* New-iTerm-Window.scpt
*
* Intended for use with QuickSilver
* I mapped option-y to running this script to create
* a new iTerm window on the current workspace
*
* Based on much Googling - very little "original" code here
* Comments/Suggestions to brad.lhotsky@gmail.com
*)