This file contains hidden or 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
-- Replace hardcoded value with a column | |
-- Outputs 2025-04-21 18:14:26.308930 | |
select DATEADD( | |
microsecond, | |
1745259266308930 % 1000000, | |
timestamp 'epoch' + (1745259266308930 / 1000000) * interval '1 second' | |
) |
This file contains hidden or 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 json | |
import urllib3 | |
http = urllib3.PoolManager() | |
def lambda_handler(event, context): | |
""" | |
Example payload: | |
{ |
This file contains hidden or 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
# Install prophet | |
FROM python:3.7-stretch | |
RUN apt-get -y install git libc-dev | |
RUN pip install pip==19.1.1 | |
WORKDIR /opt | |
RUN git clone https://github.com/facebook/prophet.git |
This file contains hidden or 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 boto3 | |
def lambda_handler(event, context): | |
client.start_export_task( | |
ExportTaskIdentifier="", | |
SourceArn="arn:aws:rds:us-east-1:", | |
S3BucketName="", | |
IamRoleArn=", | |
KmsKeyId="", | |
S3Prefix="rds-exports", |
This file contains hidden or 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 argparse | |
import hashlib | |
import os | |
def get_checksum(f): | |
md5 = hashlib.md5() | |
md5.update(open(f).read()) | |
return md5.hexdigest() |
This file contains hidden or 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
# http://nicolascadou.com/blog/2014/01/printing-actual-sqlalchemy-queries/ | |
from sqlalchemy.dialects import mysql; print str(query.statement.compile(dialect=mysql.dialect())) |
This file contains hidden or 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
#!/bin/bash | |
echo "alias cls='clear'" >> ~/.bash_aliases && source ~/.bash_aliases |
This file contains hidden or 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
var casper = require('casper').create(); | |
var fs = require('fs'); | |
casper.start('https://soundcloud.com/vlad-gonta/sets/new-1', function() { | |
this.viewport(768, 10000); | |
}).then(function () { | |
this.scrollToBottom(); | |
this.wait(1000); | |
}).then(function () { | |
this.scrollToBottom(); |
This file contains hidden or 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
#!/bin/sh | |
for i in *.m4a; do avconv -i "$i" "${i/.m4a/.mp3}"; done |
This file contains hidden or 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
#!/bin/sh | |
# Source: https://github.com/chovy/node-startup/blob/master/init.d/node-app | |
# author: Anthony Ettinger (chovy) | |
NODE_ENV="development" | |
PORT="3000" | |
APP_DIR="~/scripts-startup" | |
NODE_APP="cnsf.js" | |
CONFIG_DIR="$APP_DIR" |
NewerOlder