In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
#!/usr/bin/env python | |
#-------------------------------------------------------------------------- | |
# Tic Tac Toe game in Python | |
# Author: Mawuli Adzaku <[email protected]> | |
# Date: 20-05-2013 | |
# Tested with Python 2.7 | |
# TO RUN: | |
# sudo chmod a+x tictactoe.py | |
# ./tictactoe.py | |
# OR JUST RUN : python tictactoe.py |
package main | |
import ( | |
"bytes" | |
"encoding/gob" | |
"fmt" | |
) | |
type MyFace interface { | |
A() |
'use strict'; | |
/** | |
* Module dependencies | |
*/ | |
var actionUtil = require('sails/lib/hooks/blueprints/actionUtil'), | |
_ = sails.lodash; | |
var async = require('sails/node_modules/async'); | |
/** |
__author__ = 'dkarchmer' | |
''' | |
This script emulates a stand-alone Python based client. It relies on Boto3 to access AWS, but | |
requires your Django server to have an API for your user to access Cognito based credentials | |
Because of Cognito, the client (this script) will only get temporary AWS credentials associated | |
to your user and only your user, and based on whatever you configure your AIM Policy to be. | |
Most Cognito examples demonstrate how to use Cognito for Mobile Apps, so this scripts demonstrate | |
how to create a stand-alone Python script but operating similarly to these apps. |
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
import io | |
from IPython.nbformat import current | |
with io.open(filepath, 'r', encoding='utf-8') as f: | |
nb = current.read(f, 'json') | |
word_count = 0 | |
for cell in nb.worksheets[0].cells: | |
if cell.cell_type == "markdown": | |
word_count += len(cell['source'].replace('#', '').lstrip().split(' ')) |
import React from "react"; | |
import Files from "react-butterfiles"; | |
/** | |
* Retrieve pre-signed POST data from a dedicated API endpoint. | |
* @param selectedFile | |
* @returns {Promise<any>} | |
*/ | |
const getPresignedPostData = selectedFile => { | |
return new Promise(resolve => { |