Skip to content

Instantly share code, notes, and snippets.

View mavieth's full-sized avatar

Michael Vieth mavieth

View GitHub Profile
@nmabhinandan
nmabhinandan / gulpfile.js
Last active March 19, 2017 18:49
Express Nodemon BrowserSync Gulp
var gulp = require('gulp');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var sourcemaps = require("gulp-sourcemaps");
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');
var nodemon = require('gulp-nodemon');
var path = require('path');
@bavington
bavington / custom_events_analytics.js
Last active October 3, 2018 17:57
Pushing custom events to Google Universal Analytics (analytics.js).
jQuery(document).ready(function ($) {
$('#navquote').on('click', function() {
ga('send', 'event', 'Quick Quote Call To Action', 'click', 'Launch Lightbox Form');
});
$('#headerphone').on('click', function() {
ga('send', 'event', 'Phone Number Touch/Click', 'click', 'Header');
});
$('#footerphone').on('click', function() {
ga('send', 'event', 'Phone Number Touch/Click','click', 'Footer');
});
@ayman
ayman / TrackRegexRetweeter.py
Created March 8, 2010 23:40
This is a simple Twitter bot which listens to a track stream for a comma delimited list of terms/tags (PRIMARY_TRACK_LIST). From this stream, it will retweet any tweet that matches the secondary regex (SECONDARY_REGEX_FILTER).
#!/usr/bin/env python
# This is a simple Twitter bot which listens to a track stream for a comma delimited
# list of terms/tags (PRIMARY_TRACK_LIST). From this stream, it will retweet any
# tweet that matches the secondary regex (SECONDARY_REGEX_FILTER).
#
# This example is a #Haiti & #Chile Twitter stream listener for TweakTheTweet syntax.
#
# Requires Python 2.6
# Requires Tweepy http://github.com/joshthecoder/tweepy
#
@cheesinglee
cheesinglee / reddit_scraper.py
Created June 20, 2014 03:17
Python subreddit scraper
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 3 12:24:41 2013
@author: cheesinglee
"""
import praw
from csv import DictWriter
@retlehs
retlehs / header.php
Created April 29, 2015 04:55
Sage header template for Bootstrap top navbar component
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
import os
import pytest
from alembic.command import upgrade
from alembic.config import Config
from project.factory import create_app
from project.database import db as _db
@snay2
snay2 / watermark.py
Created March 18, 2011 17:00
How to apply a semi-transparent watermark to an image using Python
from PIL import Image, ImageDraw
def main():
# Open the original image
main = Image.open("12voltm.jpg")
# Create a new image for the watermark with an alpha layer (RGBA)
# the same size as the original image
watermark = Image.new("RGBA", main.size)
# Get an ImageDraw object so we can draw on the image
@adon-at-work
adon-at-work / multer-to-s3.js
Last active April 3, 2023 18:10
Sample File Upload From Multer to S3
var AWS = require('aws-sdk'),
fs = require('fs');
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk
AWS.config.loadFromPath('./aws-config.json');
// assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos
var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}});
function uploadToS3(file, destFileName, callback) {
@loisaidasam
loisaidasam / README.md
Last active April 5, 2023 18:37
The Masters API!
@DenisIzmaylov
DenisIzmaylov / INSTALLATION.md
Last active April 27, 2023 15:44
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment

OS X 10.11 (El Capitan) / Node.js and io.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content