Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View brainstorm's full-sized avatar

Roman Valls Guimera brainstorm

View GitHub Profile
@zyegfryed
zyegfryed / gist:814432
Created February 7, 2011 14:25
Tastypie OAuth
from oauth2 import Error
from django.utils.translation import ugettext as _
from tastypie.authentication import Authentication
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES
from oauth_provider.store import store, InvalidTokenError

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@phred
phred / pedantically_commented_playbook.yml
Last active November 3, 2023 01:55
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
class APIWrapper:
#snippet...
def poll_api(self, tries, initial_delay, delay, backoff, success_list, apifunction, *args):
time.sleep(initial_delay)
for n in range(tries):
try:
status = self.get_status()
if status not in success_list:
@dgutman
dgutman / xnat-base-setup.sh
Last active December 14, 2015 08:48
XNAT Ubuntu Install Script for 12.04 LTS
## David A Gutman dgutman _at_ emory.edu
## This script walks through install an XNAT Ubuntu Virtual Machine for a VMware Host
## Note: this script can not be run as a single bash script.
# This is a fork/update of johnpaulett's guest setup script
# https://gist.github.com/johnpaulett/206346
## VMWARE Setup: I allocated 80GB for the main XNAT partition (using Thin Provisioning)
## Also I set up an additional disk as a standalone partition to actually store all my data
## Presumably you do not want to have your VM image with your database/XNAT/etc in the same VM as
## storage
@athoune
athoune / gist:5777474
Last active August 28, 2018 22:20
Pushing mails to Elastic Search for a Kibana analysis.
#!/usr/bin/env python
import sys
# Lamson is an application, but also the best way to read email without
# struggling with "battery include" libraries.
from lamson.encoding import from_string as parse_mail
from pyelasticsearch import ElasticSearch
from pyelasticsearch.exceptions import ElasticHttpNotFoundError
@aras-p
aras-p / preprocessor_fun.h
Last active April 12, 2024 17:24
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@hatt
hatt / logstash-elasticache.pp
Last active March 13, 2017 05:35
Dynamically scoping Redis with AWS Elasticache to use the local availability zone. Batch writing is used for the shipper to reduce usage costs.
$redis_host = $::ec2_placement_availability_zone ? {
'us-west-1a' => 'logging-redis-a.<redacted>.0001.usw1.cache.amazonaws.com',
'us-west-1b' => 'logging-redis-b.<redacted>.0001.usw1.cache.amazonaws.com'
}
logstash::output::redis { 'redis-shipper':
batch => true,
host => $redis_host,
key => 'logstash',
data_type => 'list'
@rxaviers
rxaviers / gist:7360908
Last active April 23, 2024 07:02
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: