Skip to content

Instantly share code, notes, and snippets.

@m-kus
m-kus / dyor_smart_contracts.ipynb
Last active February 22, 2023 19:11
Inspecting smart contracts with PyTezos
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samlexrod
samlexrod / PostgreSQL Challenges Completed.md
Last active October 28, 2019 20:59
Here I show my commitment to challenge myself to building better queries from places such as codewars, hacker rank, or others.

PostgreSQL Challenges

  1. You need to build a pivot table WITHOUT using CROSSTAB function. Having two tables products and details you need to select a pivot table of products with counts of details occurrences (possible details values are ['good', 'ok', 'bad'].
SELECT
  distinct pro.name,
  (SELECT count(*) FROM details det2 WHERE det2.detail = 'good' AND det2.product_id = det.product_id) AS good,
  (SELECT count(*) FROM details det2 WHERE det2.detail = 'ok' AND det2.product_id = det.product_id) AS ok,
 (SELECT count(*) FROM details det2 WHERE det2.detail = 'bad' AND det2.product_id = det.product_id) AS bad
@rmoff
rmoff / 01_Spark+Streaming+Kafka+Twitter.ipynb
Last active September 17, 2020 17:41
Simple example of processing twitter JSON payload from a Kafka stream with Spark Streaming in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erikaris
erikaris / README.md
Last active February 20, 2017 01:59
PhantomJS vs PyQt4 Crawler

PhantomJS vs PyQt4 Crawler

PhantomJS usage

phantomjs crawl.js [URI] [OutDir]

PyQt4 usage

python crawl.py [URI] [OutDir]

@IamAdiSri
IamAdiSri / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Last active May 9, 2022 22:08 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./get-pip.py
@subfuzion
subfuzion / curl.md
Last active April 19, 2025 09:46
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@perrygeo
perrygeo / topo2geojson.py
Last active August 28, 2024 10:15
TopoJSON to GeoJSON converter
"""
topo2geojson.py
Convert topojson to geojson
Example Usage:
python topo2geojson.py data.topojson data.geojson
The topojson tested here was created using the mbostock topojson CLI
created with --spherical coords and --properties turned on
@jaw111
jaw111 / frame1.jsonld
Last active August 29, 2018 19:01
example skos tree in JSON-LD
{
"@context": {
"skos": "http://www.w3.org/2004/02/skos/core#"
},
"@type": "skos:ConceptScheme",
"skos:hasTopConcept": {
"@type": "skos:Concept"
}
}
@rickcnagy
rickcnagy / csv_tools.py
Created April 22, 2014 21:13
Wrapper on top of Python's csv module for reading/writing CSV sheets as dictionaries. Includes ability to lookup rows by a specific column, thereby allowing the data to be easily matched to external databases, such as QuickSchools or PipelineDeals. - csv_tools.py
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python
import csv
class CSV_IO(object):
"""class for reading/writing CSV objects
can work standalone or as the backbone for CSVMatch"""
def __init__(self, filepath):
@hfossli
hfossli / ffmpeg_sox_reverse.sh
Last active May 12, 2022 07:32
A bash script for reversing videos using ffmpeg and sox.
#!/bin/bash
# Created by Håvard Fossli <[email protected]> in 2013
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
#
# Description
# A bash script for reversing videos using ffmpeg and sox.
#
# Keywords