Skip to content

Instantly share code, notes, and snippets.

@cosenal
cosenal / package.json
Created March 21, 2014 21:35
ff-feeds
{
"name": "owncloud-feed",
"title": "owncloud-feed",
"id": "jid1-FrZBk65xVWi2Sg",
"description": "An add-on that allows users to remotely add RSS feeds to ownCloud",
"author": "github.com/apophenia",
"version": "0.1",
"preferences": [{
"name": "owncloudLocation",
OPTIONS http://host/core6/remote.php/webdav/
← 200 text/html [no content] 57.76kB/s
PROPFIND http://host/core6/remote.php/webdav/
← 207 application/xml 1.25kB 281.13kB/s
OPTIONS http://host/core6/remote.php/webdav/
← 200 text/html [no content] 84.01kB/s
PROPFIND http://host/core6/remote.php/webdav/
← 207 application/xml 1.17kB 281.74kB/s
OPTIONS http://host/core/remote.php/webdav/
← 200 text/html [no content] 85.58kB/s
@cosenal
cosenal / data_hiding.m
Last active August 29, 2015 14:13
data_hiding.m
hs = cell(1,2);
hs{1} = WernerState(2, 1);
hs{2} = WernerState(2, -1);
%% PPT Distinguishability
LocalDistinguishability(hs, 'copies', 1, 'ppt', true)
@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>
@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 / 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 / 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 / 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 / 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 / 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).