Skip to content

Instantly share code, notes, and snippets.

View askedrelic's full-sized avatar

Matt Behrens askedrelic

View GitHub Profile
from flask import Flask, session
app = Flask(__name__)
app.session = dict()
@app.route('/')
def reset():
app.session["counter"]=0
@askedrelic
askedrelic / trim.sh
Created August 15, 2017 08:23
Unix Trim
cut -c1-8
@askedrelic
askedrelic / debugging
Created August 15, 2017 08:22
Ansible snippets
- debug: var=another_fact
- name: Perform a rot13
debug: msg="The word {{ roman_name }} becomes {{ roman_name | rot13 }}"
- name: get hostvars for servers' ansible_default_ipv4
set_fact:
ip_list1: "{{ hostvars|fetchlistfromdict(groups.servers)|map(attribute='ansible_default_ipv4.address')|list }}"
- name: turn to FOO
@askedrelic
askedrelic / better move
Last active August 15, 2017 08:18
Find examples #unix
# better mv
find . -name "*.symlink" -exec sh -c 'echo "$1" ".${1%.symlink}"' _ {} \;
@askedrelic
askedrelic / ruby-help.sh
Created August 15, 2017 08:15
Ruby gems help
# install Gemfile
bundle
bundle lock
gem install
# uninstall all unnecesary gems
gem cleanup
@askedrelic
askedrelic / dates.py
Last active November 22, 2020 19:41
Python formatted dates #python
import arrow
dates = [arrow.now().replace(days=x).format('YYYY-MM-DD') for x in range(90)]
for x in dates: print x
@askedrelic
askedrelic / todo.js
Created August 15, 2017 08:13
Simple React TODO app #react
<script type="text/babel">
var SAMPLE_DATA = [
{"unread": false, "desc": "Hey, I just wanted to check in with you from Toronto. I got here earlier today.", "name": "Tilo Mitra", "avatar": "http://api.twitter.com/1/users/profile_image?screen_name=tilomitra&amp;size=bigger", "subject": "Hello from Toronto", "timestamp": "3:56pm, April 3, 2012", "content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."},
{"unread": true, "desc": "Hey, I had some feedback for pull request #51. We should center the menu so it looks better on mobile.", "name": "Eric Ferraiuolo", "avatar": "http://api.twitter.com/1/users/profile_image?screen_name=yuilibrary&amp;size=bigger", "subject": "Re: Pull Requests", "timestamp": "2:27pm, April 3, 2012", "content": "Duis aute irure dolor in reprehenderit in voluptate velit essecillum dolore eu fugiat null
#!/bin/sh
security find-generic-password -a "$1" -g 2>&1 | grep password | sed -e "s/password: \"//" -e "s/\"//"
# -*- encoding: utf-8 -*-
"""
django-thumbs by Antonio Melé
http://django.es
"""
from django.db.models import ImageField
from django.db.models.fields.files import ImageFieldFile
from PIL import Image
from django.core.files.base import ContentFile
import cStringIO
Repo README name README Filetype README Bytesize
elasticsearch/elasticsearch README.textile textile 7935
NancyFx/Nancy readme.md md 5483
timburks/cocoa-programming-with-nu README readme 432
mathjax/MathJax-dev README.txt txt 2018
forthnutter/6805 README readme 491
petdance/ack README.markdown markdown 1178
nulldesign/nd2d README.md md 9100
hercules-team/augeas README readme 3519
johnmyleswhite/ML_for_Hackers README.md md 1054