Skip to content

Instantly share code, notes, and snippets.

@juancsr
juancsr / mac-docker-withot-docker-destop.md
Last active April 17, 2024 15:05
Use docker in mac without docker-
@sarvabowmen
sarvabowmen / RatingComponent.js
Last active April 8, 2021 17:27
Convert Rating react component as web component
import * as React from 'react';
import PropTypes from 'prop-types';
class RatingComponent extends React.Component {
static propTypes = {
maxValue: PropTypes.number,
value: PropTypes.number,
onRatingUpdatedEvt: PropTypes.func
}
@kosyfrances
kosyfrances / terraform_template_to_file
Created November 29, 2019 13:10
Render terraform template to local file tested on Terraform v0.12.16
locals {
our_rendered_content = templatefile("${path.module}/yourtemplatefile.tmpl", { yourvars = var.yourvars })
}
resource "null_resource" "local" {
triggers = {
template = local.our_rendered_content
}
# Render to local file on machine
@dobesv
dobesv / dev_signed_cert.sh
Last active March 21, 2024 07:47
Script to create (1) a local certificate authority, (2) a host certificate signed by that authority for the hostname of your choice
#!/usr/bin/env bash
#
# Usage: dev_signed_cert.sh HOSTNAME
#
# Creates a CA cert and then generates an SSL certificate signed by that CA for the
# given hostname.
#
# After running this, add the generated dev_cert_ca.cert.pem to the trusted root
# authorities in your browser / client system.
#
@maddrag0n
maddrag0n / StyleguidistMuiWrapper.jsx
Created February 23, 2018 23:37
react-styleguidist setup for material-ui, react-bootstrap, babel module-resolver, TapEventPlugin
// @flow
import React from 'react';
import type { Element as ReactElement } from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import RsgWrapper from 'react-styleguidist/lib/rsg-components/Wrapper';
import injectTapEventPlugin from 'react-tap-event-plugin';
import $ from 'jquery';
@Jay991
Jay991 / solution.text
Created December 16, 2017 18:52
Solution for Yoeman Error: EACCES, permission denied '/root/.config/configstore/insight-yo.json' You don't have access to this file.
You need to create a new user and give it sudo privleges:
$adduser username
Set password prompts:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for username
Enter the new value, or press ENTER for the default
Full Name []:
@daipresents
daipresents / ErrorLog
Last active August 27, 2023 18:19
Split Jenkinsfile
Running on master in /var/lib/jenkins/workspace/MY_JOB_NAME
[Pipeline] {
[Pipeline] pwd
[Pipeline] load
[Pipeline] // load
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/MY_JOB_NAME/common.groovy
@smithclay
smithclay / index.js
Created June 16, 2017 18:30
"Hello World" AWS Lambda + Terraform Example
// 'Hello World' nodejs6.10 runtime AWS Lambda function
exports.handler = (event, context, callback) => {
console.log('Hello, logs!');
callback(null, 'great success');
}
@rtfpessoa
rtfpessoa / getopts_long.sh
Created January 21, 2017 19:06
getopts_long -- POSIX shell getopts with GNU-style long option support
#!/usr/bin/env bash
#
# getopts_long -- POSIX shell getopts with GNU-style long option support
#
# Copyright 2005-2009 Stephane Chazelas <stephane_chazelas@yahoo.fr>
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that the above copyright notice appear in all copies and that both that
@nathanlogan
nathanlogan / component.js
Created November 15, 2016 19:29
Emulate URL anchor page scroll functionality in a React component
import React, { Component } from 'react'
class MyTopLevelComponent extends Component {
componentDidMount () {
this.scrollToHashId()
}
componentDidUpdate () {
this.scrollToHashId()
}