Skip to content

Instantly share code, notes, and snippets.

View veekaybee's full-sized avatar
💫
in the latent space

Vicki Boykis veekaybee

💫
in the latent space
View GitHub Profile
@cirla
cirla / Philly PUG 2016-03-24.ipynb
Created March 24, 2016 22:56
Analyzing Philadelphia 2012 General Election Results with PySpark
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samarthbhargav
samarthbhargav / .bashrc
Last active March 3, 2018 10:01
bashrc for Hadoop
# Hadoop Properties
export HADOOP_PREFIX=/usr/local/hadoop # installation location
export HADOOP_HOME=$HADOOP_PREFIX
export HADOOP_COMMON_HOME=$HADOOP_PREFIX
export HADOOP_CONF_DIR=$HADOOP_PREFIX/etc/hadoop
export HADOOP_HDFS_HOME=$HADOOP_PREFIX
export HADOOP_MAPRED_HOME=$HADOOP_PREFIX
export HADOOP_YARN_HOME=$HADOOP_PREFIX
export PATH=$PATH:$HADOOP_PREFIX/bin
@andywirv
andywirv / gist:f312d561c9702522f6d4ede1fe2750bd
Created November 22, 2016 19:58
Update Lambda function configuration, specifically the environment variables. AWS Cli version aws-cli/1.11.20
#quotes on json, single around entire object and double on each property
aws lambda update-function-configuration --function-name=[lambda function name] --environment '{"Variables":{"abc":"124"}}'
@ZZR-china
ZZR-china / falskapp-docker-compose.yml
Created January 23, 2017 13:58
simple flask nginx mongo redis docker-compose.yml
nginx:
restart: always
build: ./nginx
ports:
- "80:80"
volumes:
- /www/static
volumes_from:
- web
links:
@slok
slok / mapreduce.py
Created September 15, 2012 11:15
MapReduce simple python example (requires 2.7 or higher, compatible with python3 also)
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012, Xabier (slok) Larrakoetxea <slok69 [at] gmail [dot] com>
#
# 3 clause/New BSD license:
# opensource: http://www.opensource.org/licenses/BSD-3-Clause
# wikipedia: http://en.wikipedia.org/wiki/BSD_licenses
#
@jesseh
jesseh / pareto.py
Created November 29, 2012 13:39
Pareto Chart with Matplotlib
import pandas as pd
import matplotlib.pyplot as plt
def combined_label(perc, tot):
"""
Format a label to include by Euros and %.
"""
return "{0:,.0f}k EUR, {1:.0f}%".format(perc * tot / 1000, perc * 100)
def cost_cum(data, focus, subject):
@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

@ept
ept / gist:4475995
Last active November 4, 2022 08:38
Syntax highlighting code for PowerPoint (Mac OS)

How to add syntax-highlighted code to PowerPoint slides (Mac OS)

  1. pygmentize -f rtf FILE | pbcopy
  2. Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
  3. In PowerPoint, Edit → Paste Special… → Styled Text.

(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!