Skip to content

Instantly share code, notes, and snippets.

@cosenal
cosenal / all_success_dag.py
Created August 5, 2018 23:15
comment on stackoverflow.com/questions/51664755
from datetime import datetime
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.dummy_operator import DummyOperator
dag = DAG(
'test_branches',
description='Test branches',
catchup=False,
@cosenal
cosenal / branch_dag_stack_overflow.py
Created August 5, 2018 16:49
stackoverflow.com/questions/51664755/
from datetime import datetime, date, timedelta
from airflow import DAG
from airflow.operators.python_operator import BranchPythonOperator, PythonOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.subdag_operator import SubDagOperator
# Dag is returned by a factory method
def sub_dag(parent_dag_name, child_dag_name, start_date, schedule_interval):
dag = DAG(
'%s.%s' % (parent_dag_name, child_dag_name),
// ==UserScript==
// @name This ain't a place for devops
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Alessandro
// @match http://<airflow-instance-url-here>/admin/
// @grant none
// ==/UserScript==
(function() {
@cosenal
cosenal / about.md
Last active June 1, 2016 12:34 — forked from antichris/about.md
Fork your own Gist

Fork your own Gist

This is a bookmarklet that adds a fully functional Fork button to your own Gist.

If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.

The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well).


@cosenal
cosenal / app.js
Created May 22, 2015 15:56
device storage -- minimum working example
(function () {
var files = navigator.getDeviceStorage('pictures');
var cursor = files.enumerate();
console.log(cursor);
cursor.onsuccess = function() {
if (this.done) {
console.log("Done");
@cosenal
cosenal / test_owncloud_waterbutler.py
Last active August 29, 2015 14:20
test osf's waterbutler owncloud provider
import asyncio
from waterbutler.providers.owncloud import OwnCloudProvider
loop = asyncio.get_event_loop()
creds = {
'owncloud': {'username': 'test', 'password': 'test'},
}
settings = {
@cosenal
cosenal / guzzletest.php
Created April 21, 2015 05:27
guzzletest for tuskkk___
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get('http://localhost/owncloud/remote.php/webdav/welcome.txt', [
'auth' => ['admin', 'password']
@cosenal
cosenal / keybase.md
Created February 14, 2015 23:37
keybase.md

Keybase proof

I hereby claim:

  • I am cosenal on github.
  • I am cosenal (https://keybase.io/cosenal) on keybase.
  • I have a public key whose fingerprint is 2316 CFD2 3DE2 1005 356D 2F20 801E 8649 5957 DD61

To claim this, I am signing this object:

@cosenal
cosenal / unstar_all.py
Last active August 29, 2015 14:15
unstar all items at once
#!/usr/bin/env python
import requests
url = 'https://example.com/index.php/apps/news/api/v1-2/items'
username = 'user';
password = 'pass';
paramsAllStarred = {
'batchSize': -1,
@cosenal
cosenal / feed.xml
Last active August 29, 2015 14:15
js injected feed
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title type="html">Demo feed</title>
<subtitle type="html">Strip out JS demo feed</subtitle>
<link rel="self" type="application/atom+xml" href="https://gist.github.com/cosenal/" />
<link rel="alternate" type="text/html" href="https://gist.github.com/"/>
<id>https://gist.github.com/</id>
<updated>2015-02-11T16:22:02+01:00</updated>
<entry>
<title type="html">Demo entry</title>