Skip to content

Instantly share code, notes, and snippets.

Omar A hagope

Block or report user

Report or block hagope

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aanari
aanari / dropbox_hook.py
Last active Nov 7, 2019
Airflow Dropbox Hook
View dropbox_hook.py
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active Mar 28, 2020
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
View understanding-word-vectors.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Jan-Zeiseweis
Jan-Zeiseweis / date_user_defined_functions_redshift.sql
Last active Jan 8, 2019
User defined python functions for date dimensions in redshift
View date_user_defined_functions_redshift.sql
create or replace function f_sk_date (ts timestamp )
returns integer
stable as $$
if not ts:
return None
return int(str(ts)[0:10].replace('-',''))
$$ language plpythonu;
create or replace function f_date (ts timestamp)
returns date
@jsheedy
jsheedy / iter_file.py
Last active Mar 7, 2020
Sometimes you need a file-like object when all you have is an iterator, for instance when using psycopg2's cursor.copy_from. This class will handle the impedance mismatch.
View iter_file.py
import io
import sys
class IteratorFile(io.TextIOBase):
""" given an iterator which yields strings,
return a file like object for reading those strings """
def __init__(self, it):
self._it = it
self._f = io.StringIO()
@probonopd
probonopd / Arduino Yun (Linino) on OpenWrt
Last active Apr 29, 2019
Install Arduino Yun (Linino) software on OpenWrt on 3rd-party devices. TODO: Fully automate install and/or use Linino rootfs image and/or build own firmware using OpenWrt Image Generator. CAVEATS: I have not yet found out how to make the Bridge use Serial (USB) instead of Serial1 (HardwareSerial) for the Leonardo. I have asked a question about t…
View Arduino Yun (Linino) on OpenWrt
opkg install luci-lib-json luci rng-tools usbutils avrdude avahi-daemon
# If rng-tools is not installable, then install it by hand from e.g., http://download.linino.org/linino_distro/linino_dev/latest/packages/rng-tools_3-2_ar71xx.ipk
# Edit your /etc/opkg.conf, add
src/gz barrier_breaker http://download.linino.org/dogstick/all-in-one/latest/packages/
# Comment out your earlier src/gz
opkg update
opkg list|grep bridge
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Mar 20, 2020
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@teffalump
teffalump / README.md
Last active Mar 6, 2020
OpenWRT adblock implementation
View README.md

Others have recently developed packages for this same functionality, and done it better than anything I could do. Use the packages instead of this script:

Description

In its basic usage, this script will modify the router such that blocked addresses are null routed and unreachable. Since the address blocklist is full of advertising, malware, and tracking servers, this setup is generally a good thing. In addition, the router will update the blocklist weekly. However, the blocking is leaky, so do not expect everything to be blocked.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active Mar 25, 2020
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@ralfbecher
ralfbecher / QlikView_Convert_from_Unix_Timestamp.qvs
Last active Dec 15, 2015
Convert from a Unix timestamp to the local time in QlikView
View QlikView_Convert_from_Unix_Timestamp.qvs
// Solution 1:
Timestamp = ConvertToLocalTime(Date(MakeDate(1970, 1, 1) + (<timestamp_field> / 86400)), '<time_zone>')
// Solution 2:
Timestamp = ConvertToLocalTime(Date(25569 + (<timestamp_field> / 86400)), '<time_zone>')
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Mar 28, 2020
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

You can’t perform that action at this time.