Skip to content

Instantly share code, notes, and snippets.

Sometimes you have to move data from one table to a different one. You usually use

insert into target select * from source

This works but have several problems:

  1. materialized columns are not properly copied
  2. it's slow
@Framartin
Framartin / extensions.py
Last active November 2, 2021 02:32
Simplest scrapy extension to send all errors and exceptions to Sentry
import sentry_sdk
from scrapy.exceptions import NotConfigured
class SentryLogging(object):
"""
Send exceptions and errors to Sentry.
"""
@classmethod
def from_crawler(cls, crawler):
@okutbay
okutbay / free_email_provider_domains.txt
Last active April 25, 2024 16:44 — forked from tbrianjones/free_email_provider_domains.txt
Most complete list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created. I also use this list in my free link shortener service https://www.cut.lu and some day i want to release an API for rela…
This file has been truncated, but you can view the full file.
0-00.usa.cc
0-180.com
0-30-24.com
0-420.com
0-900.com
0-aa.com
0-mail.com
0-z.xyz
0.pl
00.pe
/*
See https://twitter.com/renschler/status/1081666886377619457 for context,
this gist contains JS snippets you can use one after another to download a csv with your liked tweets.
*/
/* ***************************************************************************** */
/*
Scroll to load liked tweets...
Fist go to your likes page : https://twitter.com/i/likes
@jhuangtw
jhuangtw / pipenv_jupyter.sh
Last active May 28, 2020 19:19
Running Jupyter with pipenv
pipenv install ipykernel jupyter
pipenv shell
python -m ipykernel install --user --name=$(basename $(pwd))
jupyter notebook
# then in UI, switch kernel to the one matching your pipenv shell name
@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active May 17, 2024 20:07
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

@amorgun
amorgun / sample.py
Created November 10, 2017 10:51
SqlAlchemy postgres bulk upsert
from sqlalchemy.dialects import postgresql
def bulk_upsert(session: Session,
items: Sequence[Mapping[str, Any]]):
session.execute(
postgresql.insert(MyModel.__table__)
.values(items)
.on_conflict_do_update(
index_elements=[MyModel.id],
set_={MyModel.my_field.name: 'new_value'},
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 15, 2024 22:27
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A

Briefly describe what your company does and who your customers/clients are.

BeBanjo develops solutions for the Video On Demand industry. Our products help companies like AMC Networks (creators of Mad Men and Breaking Bad) in the U.S. or Sky, Channel 5 or BT Vision in the UK to manage their Video On Demand Services. We pretty much help them with everything they need to do in order to make their content available on multiple platforms and devices; this includes keeping track of their content and acquired rights, putting together a schedule, preparing content metadata, tracking the operational processes and publishing it all to the end platforms.

How many employees do you have, how many work remotely, and where are they located?

We have 14 employees:

  • 6 developers (3 in Madrid, 1 in Asturias, 1 in Berlin, 1 in London)
  • 1 Systems Administrator (Madrid)