This file contains hidden or 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
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"prefix": { | |
"type": "string", | |
"defaultValue": "master", | |
"metadata": { | |
"description": "Master node(s) name prefix" | |
} |
This file contains hidden or 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
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist | |
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist | |
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz | |
sudo pkgutil --forget org.macosforge.xquartz.pkg | |
# Log out and log in |
This file contains hidden or 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
--- | |
- name: Create render slaves on Rackspace Cloud | |
hosts: renderslaves | |
user: root | |
connection: local | |
gather_facts: False | |
tasks: | |
- name: Provision a set of instances | |
local_action: | |
module: rax |
This file contains hidden or 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
var sideBar = $('#col_channels_bg').is(':visible'); | |
$(window).on('keypress', function(e) { | |
// uses cmd+b | |
if (e.metaKey && e.charCode == 98) { | |
var display = sideBar ? 'none' : 'initial'; | |
var left = sideBar ? 0 : ''; | |
$('#col_channels_bg, #col_channels').css('display', display); | |
$('#messages_container').css('margin-left', left); | |
$('#footer').css('left', left); |
This file contains hidden or 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 python3 | |
from itertools import tee | |
# colors are floating-point 3-element tuples (doing RGBA is a matter of setting the component count) | |
def poly_gradient(colors, steps, components=3): | |
def linear_gradient(start, finish, substeps): | |
yield start | |
for i in range(1, substeps): |
This file contains hidden or 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
from aiohttp import web | |
from threading import Thread | |
import asyncio | |
import time, uuid | |
loop = asyncio.get_event_loop() | |
def long_blocking_thing(sleep): | |
time.sleep(sleep) | |
return 42 |
This file contains hidden or 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 | |
# Minimalist environmental data logger to Azure IoT Hub | |
# Rui Carmo, November 2018 | |
from envirophat import light, motion, weather, leds | |
from base64 import b64encode, b64decode | |
from hashlib import sha256 | |
from time import time, sleep | |
from urllib import quote_plus, urlencode |
This file contains hidden or 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
const puppeteer = require('puppeteer'); | |
function sleep(ms){ | |
return new Promise(resolve=>{ | |
setTimeout(resolve,ms) | |
}) | |
} | |
(async() => { |
This file contains hidden or 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
const bplist = require('bplist-creator'), | |
request = require('request'), | |
xpath = require('xpath'), | |
dom = require('xmldom').DOMParser, | |
url = require('url'), | |
fs = require('fs'); | |
const USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.1 Safari/603.1.30', | |
ACCEPT_HEADERS = { |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Tweaked for Ubuntu | |
# | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi |