Skip to content

Instantly share code, notes, and snippets.

View originalankur's full-sized avatar
🖥️
Coding underway.

Ankur Gupta originalankur

🖥️
Coding underway.
  • Bengaluru, India
View GitHub Profile
@dideler
dideler / example.md
Last active September 13, 2024 09:55
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.

The program below can take one or more plain text files as input. It works with python2 and python3.

Let's say we have two files that may contain email addresses:

  1. file_a.txt
foo bar
ok ideler.dennis@gmail.com sup
 hey...user+123@example.com,wyd
hello world!
#!/usr/bin/env python
#
# Extracts email addresses from one or more plain text files.
#
# Notes:
# - Does not save to file (pipe the output to a file if you want it saved).
# - Does not check for duplicates (which can easily be done in the terminal).
#
# (c) 2013 Dennis Ideler <ideler.dennis@gmail.com>
@lebedov
lebedov / linkedin_access_oauth1.py
Last active February 13, 2019 02:46
Get LinkedIn access tokens without having to open a web browser.
#!/usr/bin/env python
"""
Get LinkedIn OAuth1 access tokens without having to open a web browser.
Notes
-----
Based upon https://developer.linkedin.com/documents/getting-oauth-token-python
Assumes that the application API key, secret key, user name, and password are stored
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@tomysmile
tomysmile / mac-setup-redis.md
Last active August 6, 2024 01:38
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@tzmartin
tzmartin / embedded-file-viewer.md
Last active October 16, 2024 07:32
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@kurlov
kurlov / mkv embed soft subtitles
Created December 16, 2017 23:41
ffmpeg command to add .srt based subtitles to an .mkv file
ffmpeg -i in.mkv -f srt -i in.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s srt out.mkv
@tzmartin
tzmartin / release-flow.md
Created October 19, 2018 21:06
Release Flow

Release Flow


git log                 engineers
  ↳ Engineering Notes     ↳ eng managers
    ↳ Release Notes         ↳ product manager
      ↳ Blog Post             ↳ solution managers
        ↳ $$$$                  ↳ customers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KalebNyquist
KalebNyquist / airtable_helper.py
Last active August 6, 2024 02:14
Simple Download/Upload of Airtable Data into/from Python using Airtable API
import requests
import json
import pandas as pd
def airtable_download(table, params_dict={}, api_key=None, base_id=None, record_id=None):
"""Makes a request to Airtable for all records from a single table.
Returns data in dictionary format.
Keyword Arguments: