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
"use strict"; | |
const { Octokit } = require("@octokit/rest"); | |
const octokit = new Octokit({ | |
auth: 'my-personal-token' | |
}); | |
octokit.paginate( |
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
<?php | |
abstract class AbstractProperties extends \ArrayObject implements PropertiesInterface | |
{ | |
final public function getComparableArray() : array | |
{ | |
return $this->getComparableArrayRecursive([]); | |
} | |
final protected function getComparableArrayRecursive(array $stack) | |
{ |
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 | |
def download_and_untar(url, **kw): | |
import os | |
import tarfile | |
from io import BytesIO | |
try: from urllib.request import urlopen | |
except ImportError: from urllib import urlopen | |
# Options | |
try: strip_components = kw['strip_components'] |
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
#! /bin/sh | |
######################################################################################## | |
# Compresses old radacct detail files and removes very old compressed radacct files. | |
######################################################################################## | |
# Author: P. Tomulik | |
######################################################################################## | |
# Path to the programs used (for environments without $PATH set) | |
FIND=/usr/bin/find |
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
#include <string> | |
#include <iostream> | |
#include <algorithm> | |
namespace detail { | |
template<class CharT, class Traits, class SAlloc, class VAlloc> | |
void | |
string_split_impl(std::basic_string<CharT, Traits, SAlloc> const& str, CharT delim, | |
std::vector<std::basic_string<CharT, Traits, SAlloc>, VAlloc>& pieces) |
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
#include <locale> | |
#include <string> | |
#include <stdexcept> | |
std::wstring | |
widen(std::string const& str, std::codecvt<wchar_t, char, std::mbstate_t> const& cvt) | |
{ | |
if(str.empty()) | |
return std::wstring(); |
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
// clxx/common/wstring_convert.hpp | |
/** // doc: clxx/common/wstring_convert.hpp {{{ | |
* \file clxx/common/wstring_convert.hpp | |
* \brief Provides clxx::wstring_convert | |
*/ // }}} | |
#ifndef CLXX_COMMON_WSTRING_CONVERT_HPP_INCLUDED | |
#define CLXX_COMMON_WSTRING_CONVERT_HPP_INCLUDED | |
#include <string> |
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 | |
# Python ENC | |
# receives fqdn as argument | |
import yaml | |
import sys | |
enc = { | |
'classes' : { 'base' : {} }, | |
'environment' : 'production', |
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
module ToLambda | |
def to_lambda(block) | |
if Puppet::Util::Package.versioncmp(RUBY_VERSION,"1.9") >=0 | |
unless block.lambda? | |
# This code is based on: https://github.com/schneems/proc_to_lambda | |
# See also https://github.com/schneems/proc_to_lambda/issues/1 | |
if RUBY_ENGINE && RUBY_ENGINE == "jruby" | |
lambda(&block) | |
else | |
Object.new.define_singleton_method(:_, &block).to_proc |
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
# lib/puppet/backport/type/package/package_settings.rb | |
package = Puppet::Type.type(:package) | |
unless package.features.include? :package_settings | |
package.feature :package_settings ... | |
package.newproperty(:package_settings, :required_features=>:package_settings) do | |
... | |
end | |
end |