This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: node-windows | |
tasks: | |
- name: Download and Install Windows Update | |
win_updates: | |
register: update_result | |
- name: Reboot machine if necessary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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): |