Skip to content

Instantly share code, notes, and snippets.

View osde8info's full-sized avatar

Clive D osde8info

View GitHub Profile
@pdcastro
pdcastro / Dockerfile
Last active February 13, 2021 00:12
Dockerfile for "npm install balena-cli" on Ubuntu Bionic
# Sample Dockerfile for installing balena-cli on Ubuntu Bionic
# Usage:
# $ docker build -t cli .
# $ docker run -it --privileged --network host -v /var/run/docker.sock:/var/run/docker.sock cli
FROM ubuntu:18.04
# install dependencies - don't install nodejs or npm via apt-get!
RUN apt-get update && apt-get install -y curl git python g++ make
ENV NODE_VERSION v12.20.2
ENV NVM_DIR /usr/local/nvm
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
// @ts-check
'use strict'
const { join } = require('path')
const { readFile } = require('fs')
const { promisify } = require('util')
const https = require('https')
const readFileAsync = promisify(readFile)
@VerizonMediaOwner
VerizonMediaOwner / weather_ydn_sample.js
Last active May 12, 2019 12:00
Yahoo Weather API JavaScript Example
// Require node-oauth package: npm install oauth
// Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see https://opensource.org/licenses/Zlib for terms.
var OAuth = require('oauth');
var header = {
"X-Yahoo-App-Id": "your-app-id"
};
var request = new OAuth.OAuth(
null,
null,
@jsrobertson
jsrobertson / .eslintrc.json
Last active January 12, 2020 08:12
Suggested MOJ .eslintrc
{
"extends": ["airbnb", "prettier", "prettier/react"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"impliedStrict": true,
"classes": true
}
@schalkneethling
schalkneethling / dnt-helper-example-usage.js
Created October 7, 2018 17:31
Code snippets that go along with the blog post ~ Respect User Choice ~ Do Not Track
// include the helper
<script src="js/libs/dnt-helper.js"></script>
// If doNotTrack is not enabled, it is ok to add GTM
if (!_dntEnabled()) {
(function(w,d,s,l,i,j,f,dl,k,q){
w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});f=d.getElementsByTagName(s)[0];
k=i.length;q='//www.googletagmanager.com/gtm.js?id=@&l='+(l||'dataLayer');
while(k--){j=d.createElement(s);j.async=!0;j.src=q.replace('@',i[k]);f.parentNode.insertBefore(j,f);}
}(window,document,'script','dataLayer',['YOUR-GTM-ID}}']));
}
@schalkneethling
schalkneethling / anomalousWinVersions.js
Created October 7, 2018 17:21
Code snippets that go along with the blog post ~ Respect User Choice ~ Do Not Track
var anomalousWinVersions = ['Windows NT 6.1', 'Windows NT 6.2', 'Windows NT 6.3'];
@johnboy5358
johnboy5358 / combinators.js
Created June 29, 2018 04:42 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));
@rbocchinfuso
rbocchinfuso / conv2utf8.ps1
Created June 28, 2018 10:18
Convert to UTF8
Get-ChildItem "C:\Users\gerhardl\Documents\My Received Files" -Filter *.log |
Foreach-Object {
$content = Get-Content $_.FullName
Get-Content $content | Set-Content -Encoding utf8 $content
}
@Bill-Stewart
Bill-Stewart / Set-ServiceCredential.ps1
Created June 1, 2018 20:44
Sets start credentials for one or more services on one or more computers
# Set-ServiceCredential.ps1
# Written by Bill Stewart (bstewart@iname.com)
#
# PowerShell script for setting credentials for one or more services on one or
# more computers.
#
# See http://www.itprotoday.com/management-mobility/changing-service-credentials-using-powershell
#requires -version 2