This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i CAPITOJINX.wav -f mp3 capitojinx.mp3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case when "Some_Value" IS NULL then 0 else "Some_Value" end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#county | |
right( ('000' || tostring( "myfield" )), 4) | |
#state | |
right( ('0' || tostring( "fips" )), 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://github.com/skepticli/tutorial-screencast-to-gif | |
#command line | |
mkdir frames | |
ffmpeg -i my-screencast.mov -r 3 frames/image.%03d.png | |
#At this point it might be useful to go into your frames | |
#directory and delete extra images, most likely frames at | |
#the start and end of your video/gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://stackoverflow.com/questions/1345827/how-do-i-find-the-time-difference-between-two-datetime-objects-in-python | |
>>> import datetime | |
>>> a = datetime.datetime.now() | |
>>> b = datetime.datetime.now() | |
>>> c = b - a | |
datetime.timedelta(0, 8, 562000) | |
>>> divmod(c.days * 86400 + c.seconds, 60) | |
(0, 8) # 0 minutes, 8 seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#virtual environment | |
>> cd [project-path] | |
>> mkvirtualenv -a ./ [-r requirements_file] ENVNAME | |
#install django in virtualenv | |
>> pip install Django | |
#create django project | |
>> django-admin startproject mysite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=if(isblank(B2),A1,B2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
data_dir = '/Users/akanik/data/csv/' | |
file1 = 'whatever-data-1.csv' | |
file1_path = data_dir + file1 | |
#Make sure your combined file does not live within your data_dir. | |
#This will cause an endless loop of writing | |
combined_file = '/Users/akanik/data/whatever-data-ALL.csv' | |
fout = open(combined_file,'a') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.commandlinefu.com/commands/view/9002/extracting-a-range-of-pages-from-a-pdf-using-ghostscript | |
# commandline | |
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=14 -dLastPage=17 -sOutputFile=OUTPUT.pdf ORIGINAL.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://gist.github.com/oag335/9959241 | |
response_data['real_date'] = pd.to_datetime('1899-12-30') + pd.to_timedelta(response_data['date'],'D') |