Skip to content

Instantly share code, notes, and snippets.

View moxpower's full-sized avatar
🦊

moxpower moxpower

🦊
View GitHub Profile
@kristw
kristw / .block
Last active July 31, 2017 09:57
Canvas Exploration (with selectable blending options)
license: mit
@blink1073
blink1073 / qgrid_ipython.ipynb
Last active February 4, 2016 11:22
QGrid IPython Widget
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dnprock
dnprock / index.html
Last active February 16, 2023 19:00
US States Map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active July 30, 2025 09:09
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@janbaer
janbaer / gist:5045798
Created February 27, 2013 06:55
Convert CSV to Json with powershell
param
(
[string] $inputFile,
[string] $outputFile
)
if (($inputFile -eq $null) -or ($outputFile -eq $null)) {
"usage: convert_csv_to_json.ps1 [inputFile] [outputFile]"
return;
}
@why-not
why-not / gist:4582705
Last active June 21, 2025 06:24
Pandas recipe. I find pandas indexing counter intuitive, perhaps my intuitions were shaped by many years in the imperative world. I am collecting some recipes to do things quickly in pandas & to jog my memory.
"""making a dataframe"""
df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'))
"""quick way to create an interesting data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
"""convert a dictionary into a DataFrame"""
"""make the keys into columns"""
df = pd.DataFrame(dic, index=[0])