Skip to content

Instantly share code, notes, and snippets.

BetterProgramming

Block or report user

Report or block BetterProgramming

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
import React from 'react';import ReactDOM from 'react-dom';import './index.css';import App from './App';import * as serviceWorker from './serviceWorker';
import { breedsReducer, imagesReducer } from './reducers';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import { combineReducers } from 'redux'
const dogApp = combineReducers({
breeds: breedsReducer,
images: imagesReducer
})
const store = createStore(dogApp)
View docker-compose.yml
version: '3'
services:
mysql-development:
image: mysql:8.0.17
environment:
MYSQL_ROOT_PASSWORD: helloworld
MYSQL_DATABASE: testapp
ports:
View docker-compose.yml
version: '3'
services:
mysql-development:
image: mysql:8.0.17
environment:
MYSQL_ROOT_PASSWORD: helloworld
MYSQL_DATABASE: testapp
ports:
View .bashrc
$ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
$ export CUDA_HOME=/usr/local/cuda
$ export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}
$ export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
$ source ~/.bashrc
$ sudo ldconfig
View squadCommander.cpp
#include <stdio.h>
#include <vector>
#include "Soldier.hpp"
class SquadCommander
{
public:
void OrderRetreat()
{
for(int index = 0; index < _squad.size(); ++index)
View soldierClassExample.cpp
#include "Soldier.hpp"
#include "JetpackSoldier.hpp"
#include <stdio.h>
class Jeep
{
public:
Jeep() : _driver(nullptr), _passenger(nullptr), _rearLeftPassenger(nullptr), _rearRightPassenger(nullptr)
{
View soldierClassExample.cpp
#include "Soldier.hpp"
#include <stdio.h>
class Jeep
{
public:
Jeep() : _driver(nullptr), _passenger(nullptr), _rearLeftPassenger(nullptr), _rearRightPassenger(nullptr)
{
}
View sum.cpp
#include <iostream>
int Sum(int a, int b)
{
return a + b;
}
float Sum(float a, float b)
{
return a + b;
}
int main(int argc, const char * argv[]) {
View concurrent.js
var concurrent = async function() {
startTime = performance.now();
const resolveAfter3seconds = promiseTRSANSG(3);
console.log("Promise for resolveAfter3seconds created at ", executingAt());
const resolveAfter4seconds = promiseTRSANSG(4);
console.log("Promise for resolveAfter4seconds created at ", executingAt());
resolveAfter3seconds.then(function(){
console.log("resolveAfter3seconds resolved at ", executingAt());
});
resolveAfter4seconds.then(function(){
View parallel.js
var parallel = async function() {
startTime = performance.now();
promisesArray = [];
console.log(executingAt());
promisesArray.push(promiseTRSANSG(3));
promisesArray.push(promiseTRSANSG(4));
result = await Promise.all(promisesArray);
console.log(result);
console.log(executingAt());
}
You can’t perform that action at this time.