Skip to content

Instantly share code, notes, and snippets.

@d-wasserman
d-wasserman / FeatureTabletoDataframe.py
Last active May 20, 2024 23:55
Functions to convert a ArcGIS Table/Feature Class in arcpy to a pandas dataframe. For other options, check the new ArcGIS Python API, but this works across versions.
import arcpy
import pandas as pd
def arcgis_table_to_df(in_fc, input_fields=None, query=""):
"""Function will convert an arcgis table into a pandas dataframe with an object ID index, and the selected
input fields using an arcpy.da.SearchCursor.
:param - in_fc - input feature class or table to convert
:param - input_fields - fields to input to a da search cursor for retrieval
:param - query - sql query to grab appropriate values
:returns - pandas.DataFrame"""
@5z1punch
5z1punch / analyse.py
Created February 6, 2023 04:56
binance futures transaction history csv dump analyse
import csv
from enum import Enum
import decimal
# dump data for one year from https://www.binance.com/my/orders/futures/transactionhistory Big Data Dump
data = []
with open(r'/your/dump/data/path/0.csv', newline='') as csvfile:
spamreader = csv.reader(csvfile)
@lopspower
lopspower / README.md
Last active May 20, 2024 23:50
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@macshome
macshome / defang.md
Last active May 20, 2024 23:49
How to defang system protections on macOS

How to Defang macOS System Protections

If you want to change things on the root drive of a Mac you will need to take some steps to disable the built in security of the system. Most of these steps are the same regardless if you are on Intel or Apple Silicon. If there is a difference it is noted.

Note that all of these things put a Mac into an unsupported and less secure state.

Make sure you either perform these steps in a VM or that you reset the protections after you are done poking around

Protections and Terms

(This list is not exahustive on the details of each. Check the links at the end for more info.)

@DakotaLMartinez
DakotaLMartinez / instructions.md
Last active May 20, 2024 23:48
Adding an SSH key to GitHub (Mac OS X or Linux)

You need to do this if you try this command:

ssh -T git@github.com

and you get something that says

git@github.com: Permission denied (public key).
@qoomon
qoomon / conventional_commit_messages.md
Last active May 20, 2024 23:33
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@sebmarkbage
sebmarkbage / The Rules.md
Last active May 20, 2024 23:30
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.