Skip to content

Instantly share code, notes, and snippets.

View Rockncoder's full-sized avatar
💭
A coder's got to code

RocknCoder Rockncoder

💭
A coder's got to code
View GitHub Profile
@Rockncoder
Rockncoder / flutter_setup.md
Last active October 10, 2023 01:25
macOS Flutter Setup

MacOS Flutter Setup with Brew

  • Tools
    • Xcode
      • sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
      • sudo xcodebuild -runFirstLaunch
      • sudo gem install cocoapods
      • might need this too:
        • sudo gem install activesupport -v 6.1.7.6
  • Android Studio
@Rockncoder
Rockncoder / CMakeLists.txt
Last active May 8, 2022 20:08
CMakeLists.txt file for building an app with the JsonCpp library. This macOS specific since it assumes the use of homebrew to install the library, but gist of the idea will also work on Linux.
cmake_minimum_required(VERSION 3.22)
project(jsontest)
find_package(PkgConfig REQUIRED)
set(CMAKE_CXX_STANDARD 17)
# brew install jsoncpp
# jsoncpp library was installed via homebrew, so point to its directories
link_directories("/opt/homebrew/lib")
@Rockncoder
Rockncoder / cpp11_musings.cpp
Created July 26, 2020 22:38
C++11 Things to explore further
#include <iostream>
using namespace std;
int main() {
int array[] = {1, 2, 3, 4, 5};
long sum = 0;
for (const int x: array) {
sum += x;
}
@Rockncoder
Rockncoder / Dockerfile
Created October 7, 2018 13:15
Docker file for compiling Beast_HTTP_Server
FROM ubuntu:18.10
RUN apt-get -qq update
RUN apt-get -qq upgrade
WORKDIR /usr/src
RUN apt-get -qq install libboost-all-dev cmake build-essential libtcmalloc-minimal4 libssl-dev openssl git && \
ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc_minimal.so && \
git clone https://github.com/nlohmann/json.git && \
git clone https://github.com/nlohmann/fifo_map.git && \
git clone https://github.com/0xdead4ead/beast_http_server.git && \
@Rockncoder
Rockncoder / unicorns.js
Created May 19, 2018 04:14
The JavaScript MongoDB insert file for the book, The Little MongoDB Book
db.unicorns.insert({
name: 'Horny',
dob: new Date(1992, 2, 13, 7, 47),
loves: ['carrot', 'papaya'],
weight: 600,
gender: 'm',
vampires: 63
});
db.unicorns.insert({
name: 'Aurora',
@Rockncoder
Rockncoder / options-reducers-final.js
Last active October 18, 2017 21:06
The final version of the options reducers.
case SUBMIT_CHANGED_OPTIONS: {
const newOptionsList = state.standardOptionsList.map((option) => {
const pay = action.payload.find(a => a.optionId === option.optionId);
if (pay) {
option.isSelected = pay.isSelected; // eslint-disable-line
}
return option;
});
return {
...state,
@Rockncoder
Rockncoder / options-reducers-initial.js
Created October 18, 2017 20:51
The initial version of the options reducers.
case SUBMIT_CHANGED_OPTIONS: {
const standardOptions = state.standardOptionsList;
const newOptionsList = standardOptions.map((option) => {
const newOption = {};
newOption.optionId = option.optionId;
newOption.displayName = option.displayName;
newOption.categoryName = option.categoryName;
newOption.isSelected = option.isSelected;
const payload = action.payload;
@Rockncoder
Rockncoder / ReactNative-TransformFix
Last active August 27, 2017 17:37
The command line fix for the react native transform error.
yarn remove babel-preset-react-native
yarn add babel-preset-react-native@2.1.0
npm link #(babel-preset-react-native -- sometimes you may need to included the package)
rm -rf node_modules (PC delete node_modules directory)
npm install
react-native run-android
@Rockncoder
Rockncoder / results-list.component.html
Last active April 5, 2017 00:49
Renders the GitHub Search results
<div>
<h2>Total Results: {{total | number }}</h2>
<div class="button-row">
<button md-raised-button (click)="previousPage()" [disabled]="!previousUrl">Previous</button>
<button md-raised-button (click)="nextPage()" [disabled]="!nextUrl">Next</button>
</div>
<md-list>
<md-list-item *ngFor="let item of items">
<img md-list-avatar md-line src="{{item.owner.avatar_url}}"/>
<h2 md-line> {{item.full_name}}</h2>
@Rockncoder
Rockncoder / results-list.component.ts
Last active April 5, 2017 00:42
Uses the git-hub.service to render results
import {Component, OnInit} from '@angular/core';
import {GitHubService} from '../git-hub.service';
@Component({
selector: 'app-results-list',
templateUrl: './results-list.component.html',
styleUrls: ['./results-list.component.css']
})
export class ResultsListComponent implements OnInit {