Skip to content

Instantly share code, notes, and snippets.

View papajo's full-sized avatar

P Joshi papajo

View GitHub Profile
@papajo
papajo / HashContract.sol
Created December 13, 2018 10:02
HashContract.sol
pragma solidity ^0.5.1;
contract Contract {
string ipfsHash;
function sendHash(string memory x) public {
ipfsHash = x;
}
function getHash() public view returns (string memory x) {
return ipfsHash;
@papajo
papajo / quick-tips.txt
Last active November 19, 2018 00:21
quick tips
#echo "# teslaranger" >> README.md
#git init
#git add README.md
#git commit -m "first commit"
#git remote add origin https://github.com/papajo/teslaranger.git
#git push -u origin master
#…or push an existing repository from the command line
# git remote add origin https://github.com/papajo/teslaranger.git
#git push -u origin master
@papajo
papajo / TestEthereumContract.sol
Created October 9, 2018 18:11
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.24;
contract TestEthereumContract {
string myString;
mapping(address => uint) balance;
function setMyString(string _myString) public {
myString = _myString;
}

Frontend Masters—Deploying Full Stack: Node.js & React on AWS

You should have the following completed on your computer before the workshop:

  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Unfortunately, you'll need to be on Node 9.x or earlier. Dependencies are hard and one of the dependencies of one of our dependencies is set to not allow Node 10.x.
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Install multi-factor authentication app (e.g. Authy, Google Authenticator, Duo).
  • Install the AWS CLI. (brew install awscli should do the trick. Otherwise, you'll need Python and PIP, which you can install using brew install python.)
@papajo
papajo / info.plist
Created July 20, 2016 02:12 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@papajo
papajo / ttt-8-turn-q-000
Created May 29, 2016 20:28
ttt-8-turn-q-000
Failures:                                                                       
                                                                                
  1) ./lib/turn.rb #turn validates the input correctly                          
     Failure/Error: expect(self).to receive(:valid_move?).with(board, 0).and_ret
urn(true)                                                                       
       (#<RSpec::ExampleGroups::LibTurnRb::Turn:0x000000025c8d50>).valid_move?([
" ", " ", " ", " ", " ", " ", " ", " ", " "], 0)                                
           expected: 1 time with arguments: ([" ", " ", " ", " ", " ", " ", " ",
 " ", " "], 0)                                                                  
           received: 0 times       
@papajo
papajo / ttt-5-move-rb-q-000  
Created May 28, 2016 03:46
ttt-5-move-rb-q-000  
Output:
Failures:                                                                       
                                                                                
1) ./bin/move executing a CLI Application defines a board variable            
     Failure/Error: board = get_variable_from_file("./bin/move", "board")       
     NoMethodError:                                                             
       undefined method `[]' for nil:NilClass   
2) ./bin/move executing a CLI Application calls move passing the index        
     Failure/Error: run_file("./bin/move")                                      
(function addUtmParams(source, medium, campaign) {
$("a").each(function () {
var $this = $(this);
var linkHref = $this.attr("href");
if (linkHref.indexOf(window.location.hostname) < 0) {
var updateLink = updateQueryString({
utm_source: source,
utm_medium: medium,
utm_campaign: campaign
}, linkHref);
@papajo
papajo / .bash_profile
Created February 21, 2016 14:48 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
<!DOCTYPE html>
<html>
<head>
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">
<link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">
<link rel="stylesheet" href="main.css">
<style id="jsbin-css">