Skip to content

Instantly share code, notes, and snippets.

View snobear's full-sized avatar
🎸

Jason Ashby snobear

🎸
  • NC
  • 08:44 (UTC -04:00)
View GitHub Profile
@leonardreidy
leonardreidy / prep-contacts-for-ponymailer
Created July 5, 2013 14:07
Parse html file with Beautiful Soup, find emails and names and output as json, ready for ponymailer.rb. Emails are found (with href=mailto) and names (inside <strong> tags). The program creates a single list that contains both names, and emails, and then output it as json, ready for ponymailer to send.
# A simple python script to extract names, and emails from
# a certain online directory
import os, json
from bs4 import BeautifulSoup
#get a list of the files in the current directory
inputfiles = os.listdir(os.getcwd())
def postproc(inputfiles):
@nodesocket
nodesocket / kibana
Created July 7, 2013 01:49
Kibana init.d service script.
#!/bin/bash
### BEGIN INIT INFO
# Provides: kibana
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Make sense of a mountain of logs.
### END INIT INFO
@DamonOehlman
DamonOehlman / README.md
Last active October 30, 2023 20:03
General WebRTC tips and tricks collated over time
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 23, 2024 23:26
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@snobear
snobear / clone.py
Last active October 17, 2023 06:39
Clone VM from template with pyVmomi
#!/usr/bin/env python
"""
NOTE:
This gist has been moved to EZmomi:
https://github.com/snobear/ezmomi
Give it a star or fork. Contributions are more than welcome. I'm hoping it will become an easy cli tool for
common VMware tasks.
@ksexton
ksexton / CHEATSHEET.md
Created March 10, 2014 19:19
mcollective cheatsheet

mcollective cheatsheet

Agents

List installed agents

$ mco plugin doc
@maus-
maus- / logstash.conf
Created May 14, 2014 03:52
Logstash conf for rsyslog + auditd logs into elasticsearch
input {
syslog = {
type => syslog
port => 514
}
}
filter {
grok {
type => "auditd"
pattern => [" AUDIT type=%{WORD:audit_type} msg=audit\(%{NUMBER:audit_epoch}:%{NUMBER:audit_coun
@snobear
snobear / mco-cheat-sheet
Last active December 10, 2021 16:51
MCollective cheat sheet
# MCollective Cheat Sheet
MCollective is a server orchestration tool that is built by Puppet Labs and so is tightly integrated with the puppet infrastructure. Commands a run from the control aka "client" server.
## Finding/listing hosts
List all
```
mco find
@simlegate
simlegate / custom-error-page
Created October 31, 2014 05:35
Nginx return custom json
error_page 400 404 405 =200 @40*_json;
location @40*_json {
default_type application/json;
return 200 '{"code":"1", "message": "Not Found"}';
}
error_page 500 502 503 504 =200 @50*_json;
location @50*_json {

Build a scalable Twitter clone with Django and GetStream.io

In this tutorial we are going to build a Twitter clone using Django and GetStream.io, a hosted API for newsfeed development.

We will show you how easy is to power your newsfeeds with GetStream.io. For brevity we leave out some basic Django-specific code and recommend you refer you to the Github project for the complete runnable source code. At the end of this tutorial we will have a Django app with a profile feed, a timeline feed, support for following users, hashtags and mentions.

I assume that you are familiar with Django. If you're new to Django the [official tutorial] (https://docs.djangoproject.com/en/2.0/intro/) explains it very well.