100
101
---
100
100
101
---
101
@import Darwin; | |
@import Foundation; | |
@import IOKit; | |
/******* | |
This should change the brightness level of a single external display connected to an M1 MBP or MBA relative to the current setting using DDC/CI. Reportedly does not work on M1 Mini. | |
Credits to @tao-j and @alin23 | |
Compile: |
######################################################################### | |
# ================================================== # | |
# $ Mikrotik RouterOS update script for CloudFlare $ # | |
# ================================================== # | |
# # | |
# - You need a CloudFlare account & api key (look under settings), # | |
# a zone and A record in it # | |
# - All variables in first section are obvious, except CFid, # | |
# To obtain CFzoneid use following command in any unix shell: # | |
# curl -X GET "https://api.cloudflare.com/client/v4/zones" -H "X-Auth-Email: YOUR_EMAIL" -H "X-Auth-Key: YOUR_API_KEY" -H "Content-Type: application/json" | python -mjson.tool |
/* | |
Adapted from https://github.com/sindresorhus/github-markdown-css | |
The MIT License (MIT) | |
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) | |
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 |
🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert
and mkcert -install
. Keep it simple!
This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl
, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.
sudo nano /etc/ssl/localhost/localhost.conf
export class EventEmitter<Events, K = keyof Events|symbol> { | |
addListener(event: K, listener: (...args: any[]) => void): this; | |
on(event: K, listener: (...args: any[]) => void): this; | |
once(event: K, listener: (...args: any[]) => void): this; | |
removeListener(event: K, listener: (...args: any[]) => void): this; | |
removeAllListeners(event?: K): this; | |
setMaxListeners(n: number): this; | |
getMaxListeners(): number; | |
listeners(event: K): Function[]; | |
emit(event: K, ...args: any[]): boolean; |
<?php | |
require_once __DIR__.'/V8JsNodeModuleLoader_FileAccessInterface.php'; | |
require_once __DIR__.'/V8JsNodeModuleLoader_NormalisePath.php'; | |
/** | |
* Simple Node.js module loader for use with V8Js PHP extension | |
* | |
* This class understands Node.js' node_modules/ directory structure | |
* and can require modules/files from there. | |
* |
function logClass(target: any) { | |
// save a reference to the original constructor | |
var original = target; | |
// a utility function to generate instances of a class | |
function construct(constructor, args) { | |
var c : any = function () { | |
return constructor.apply(this, args); | |
} |
######################################################################### | |
# ================================================== # | |
# $ Mikrotik RouterOS update script for CloudFlare $ # | |
# ================================================== # | |
# # | |
# - You need a CloudFlare account & api key (look under settings), # | |
# a zone and A record in it # | |
# - All variables in first section are obvious, except CFid, # | |
# To obtain CFid use following command in any unix shell: # | |
# curl https://www.cloudflare.com/api_json.html -d 'a=rec_load_all' -d 'tkn=YOUR_API_KEY' -d '[email protected]' -d 'z=domain.com'|python -mjson.tool |
var flattenObject = function(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object') { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; |