Skip to content

Instantly share code, notes, and snippets.

View SaschaHeyer's full-sized avatar
👨‍🚀

Sascha Heyer SaschaHeyer

👨‍🚀
View GitHub Profile
@jgrahamc
jgrahamc / collage.py
Created August 8, 2019 11:53
Create a random photo collage from a directory of square photographs (all the same size)
# Makes a collage image from a directory full of images
#
# Assumes all the images are the same size and square
from os import listdir
from PIL import Image
import random
import math
images = listdir('.')
@vijaynoothi
vijaynoothi / PY0101EN-2-3-Dictionaries.ipynb
Created July 19, 2019 08:20
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vickyqian
vickyqian / twitter crawler.txt
Last active July 23, 2023 16:52
A Python script to download all the tweets of a hashtag into a csv
import tweepy
import csv
import pandas as pd
####input your credentials here
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@ravibhure
ravibhure / git_rebase.md
Last active April 3, 2024 08:38
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@ffittschen
ffittschen / gitconfig.md
Last active May 5, 2024 16:37
Use IntelliJ or WebStorm as git mergetool with SourceTree

Use IntelliJ or WebStorm as git mergetool

Configure Sourcetree

The merge tool that ships with JetBrain's IntelliJ IDEA or WebStorm is really awesome and way better than FileMerge. It is quite simple to configure SourceTree to use it as the default mergetool:

  1. Open the SourceTree preferences and select the Diff tab
  2. Choose Custom both as Visual Diff Tool and as Merge Tool
  3. Paste the following commands into the textfields:
  • Diff Command: /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea diff