Skip to content

Instantly share code, notes, and snippets.

View piccoloaiutante's full-sized avatar

Michele Capra piccoloaiutante

View GitHub Profile
@piccoloaiutante
piccoloaiutante / generate_remmina.py
Last active March 15, 2017 08:21
Ansible module for secret for remmina
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright Node.js contributors. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
@piccoloaiutante
piccoloaiutante / vs2015-ansible-playbook.yaml
Last active November 8, 2016 17:10
First draft for support of windows update and reboot for NodeJS build script
---
- hosts: node-windows
tasks:
- name: Download and Install Windows Update
win_updates:
register: update_result
- name: Reboot machine if necessary
@piccoloaiutante
piccoloaiutante / TestPush.csx
Created November 6, 2013 16:59
Test your Windows Phone 8 push notification using Scriptcs (remember to insert your push notification uri at line 6): scriptcs .\TestPush.csx -- "your test message"
using System.Net;
// Get the URI that the Microsoft Push Notification Service returns to the push client when creating a notification channel.
// Normally, a web service would listen for URIs coming from the web client and maintain a list of URIs to send
// notifications out to.
string subscriptionUri = "YOUR PUSH NOTIFICATION URL";
HttpWebRequest sendNotificationRequest = (HttpWebRequest)WebRequest.Create(subscriptionUri);
# Metaprogramming/Singleton.py
class Singleton(type):
instance = None
def __call__(cls, *args, **kw):
if not cls.instance:
cls.instance = super(Singleton, cls).__call__(*args, **kw)
return cls.instance
class ASingleton(object):