Skip to content

Instantly share code, notes, and snippets.

@ryanpraski
ryanpraski / google_analytics_api_v3_10krows_nosampling_multiple_profiles_ryanpraski.py
Last active February 1, 2024 13:44
A solution for exporting more than 10,000 rows and a solution for the sampling limitations of Google Analytics using Python and the Google Analytics API. Includes functionality to pull data from multiple Google Analytics profiles.
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# 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
:: F.E.A.R. low framerate workaround with Logitech hardware, by igordcard.
:: Official page URL: http://igordcard.blogspot.com/2013/01/sudden-fps-drop-in-fear-logitech.html
:: Steam version edit by zacr0.
:: 2013/01/26
@echo off
devcon disable HID\VID_046D* &:: Disable all Logitech HID devices.
devcon enable HID_DEVICE_SYSTEM_MOUSE &:: The previous command disables too much and the mouse may stop working, but this line fixes it.
start steam://rungameid/21090 &:: Run the game!
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@igordcard
igordcard / gmail.sh
Last active August 29, 2015 13:57 — forked from anonymous/gmail.sh
#!/bin/bash
function gmail() {
from=$1
user=$1
to=$2
stty -echo </dev/tty;
read -p "Password: " passw < /dev/tty
echo
stty </dev/tty echo
@igordcard
igordcard / pastebin.sh
Last active June 12, 2018 10:50 — forked from yevgenko/pastebin.sh
Updated to the latest Pastebin.com API.
#!/bin/bash
# Paste at Pastebin.com using command line (browsers are slow, right?)
# coder : Anil Dewani
# date : November 7, 2010
# forker : Igor Duarte Cardoso
# date : March 12, 2014
# Don't forget to set your Unique Developer API Key here
# http://pastebin.com/api#1
API_KEY=
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

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

@chrisle
chrisle / simple_google_analytics.rb
Last active February 16, 2023 07:30
My simple Google Analytics API export API. Exports GA data as an array of flattened hashes with a SHA1 signature. No DSL, no sugar.
require 'digest'
# = simple_google_analytics.rb
#
# Chris Le <chris at iamchrisle dot com>
#
# This module is an wrapper to export data from Google Analytics as a flattened
# hash suitable for database storage. It does not require any other gems other
# than 'oauth'. I used this simply to get metrics and directly store them in
# a database.
@masak
masak / explanation.md
Last active April 11, 2024 02:50
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

anonymous
anonymous / gmail.sh
Created April 5, 2012 03:00
Send gmail from command line (easier).
function gmail () {
$from=<your_email>
$user=<your_email>
stty -echo </dev/tty;
read -p "Password: " passw < /dev/tty
echo
stty </dev/tty echo
opts="-S smtp-use-starttls \