Skip to content

Instantly share code, notes, and snippets.

@odracci
odracci / slack.py
Created July 3, 2018 08:49 — forked from boxysean/slack.py
PythonSlackOperator -- how I've integrated notifications into my PythonOperators
# airflow/plugins/slack.py
import logging
from airflow.operators.python_operator import PythonOperator
from airflow.plugins_manager import AirflowPlugin
from slackclient import SlackClient
from titan.utils import config
<?php $time_start = microtime(true);
// Add multiple IPs to blacklist, whitelist or unlist them on Cloudflare using CloudFlare API by AzzA <azza@broadcasthe.net>
// Ed Cooper 2015 - https://blog.ed.gs
// Version 1.0
// Configure your API key and email address below
$cfemailaddress = "your@email.com"; // Cloudflare email address
$cfapikey = "1234123412341234123412341234"; // Cloudflare API key
@odracci
odracci / nginx.conf
Created October 21, 2016 23:48 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@odracci
odracci / pf.md
Created January 2, 2016 16:38 — forked from ryanzhou/pf.md
Getting Pow to work in OS X Yosemite

Getting Pow to work in OS X Yosemite

Some parts taken from: https://gist.github.com/kujohn/7209628

ipfw is officially deprecated and removed in OS X Yosemite. Pow requires another program pf to handle the port forwarding.

1. Anchor file

Create file /etc/pf.anchors/pow

Keybase proof

I hereby claim:

  • I am odracci on github.
  • I am odracci (https://keybase.io/odracci) on keybase.
  • I have a public key whose fingerprint is AD25 1AF8 7D1A A7AB 3BAD 50F6 62B9 964D 377F E91C

To claim this, I am signing this object:

#!/usr/bin/env bash
# Usage: git-branch-status
# Show how many commits each branch is ahead or behind its upstream.
branch=`git rev-parse --abbrev-ref HEAD`
git for-each-ref --format='%(refname:short) %(upstream:short)' refs/heads | \
while read local upstream; do
<?php
namespace Nelmio\HomeBundle\Tests\Controller;
use Nelmio\HomeBundle\Controller\ContactController;
use Liip\FunctionalTestBundle\Test\WebTestCase;
class ContactControllerTest extends WebTestCase
{
public function testEmail()
@odracci
odracci / LoadDataFixturesCommand.php
Last active December 18, 2015 10:19
LoadDataFixturesCommand with Nelmio/Alice
<?php
namespace Vendor\Bundle\Command;
use Nelmio\Alice\Fixtures;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand;
@odracci
odracci / gist:4356918
Last active December 10, 2015 01:18 — forked from stefanosala/gist:3881637
NameVirtualHost *:80
<VirtualHost *:80>
ServerName dev.lan
ServerAlias *.dev.lan
DocumentRoot /Users/rick/projects/php
<Directory /Users/rick/projects/php>
#AllowOverride All
AllowOverride None
@odracci
odracci / README.markdown
Created November 20, 2012 16:47 — forked from Yavari/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string