Skip to content

Instantly share code, notes, and snippets.

View neotheicebird's full-sized avatar

prash neotheicebird

  • Chennai
View GitHub Profile
@jolexa
jolexa / invalidate-all.py
Created October 24, 2018 14:07
Invalidate CloudFront Cache with boto3
from time import time
import sys
import boto3
client = boto3.client('cloudfront')
# Uncomment this to pass a URL to the script
#def get_id(url):
# print("get_id args: {0}".format(url))
# # url: asdf.cloudfront.net
# # return: E2134123ASDF
@tossmilestone
tossmilestone / Flake8.txt
Created March 30, 2018 06:55
Flake8 integrated with PyCharm
How to manually setup flake8 as PyCharm external tool
File / Settings / Tools / External Tools / Add
Name: Flake8
Program: $PyInterpreterDirectory$/python
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$
Working directory: $ProjectFileDir$
Output Filters / Add
Name: Filter 1
anonymous
anonymous / prime_conspiracy.py
Created March 15, 2016 06:23
Demonstrate the "prime conspiracy"
'''Demonstrate the "prime number conspiracy" as described at
https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/
"Among the first billion prime numbers, for instance, a prime ending in
9 is almost 65 percent more likely to be followed by a prime ending in 1
than another prime ending in 9. In a paper posted online today, Kannan
Soundararajan and Robert Lemke Oliver of Stanford University present
both numerical and theoretical evidence that prime numbers repel other
would-be primes that end in the same digit, and have varied
predilections for being followed by primes ending in the other possibl
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 28, 2024 03:34
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Uberi
Uberi / realtime-plot.py
Created April 25, 2015 02:10
Realtime plotting with Matplotlib.
#!/usr/bin/env python3
import time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
@ivanov
ivanov / mpl_gradient_hack.py
Created April 22, 2013 23:21
gradient lines in matplotlib
#!/usr/bin/env python
"""A quick hack to draw gradient lines using a colormap.
This was written in response to <Baribal>'s question on IRC.
There are two functions provided here:
`plot_gradient_hack` takes two arguments, p0 and p1, which are both (x,y)
pairs, and plots a gradient between them that spans the full colormap.
@maximebf
maximebf / gist:3986659
Created October 31, 2012 11:56
Jinja2 macro to render WTForms fields with Twitter Bootstrap
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="control-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ field.id }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}: