Skip to content

Instantly share code, notes, and snippets.

View jensendarren's full-sized avatar

Darren Jensen jensendarren

View GitHub Profile
@jensendarren
jensendarren / bashrc
Created July 27, 2015 01:51
Add git alias to your terminal command set
# Add this to your ~/.bashrc file then run `source ~/.bashrc`
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias gg='git grep -i'
alias go='git checkout '

Keybase proof

I hereby claim:

  • I am jensendarren on github.
  • I am jensendarren (https://keybase.io/jensendarren) on keybase.
  • I have a public key ASCUxtscnfGIjSlMCwIboYoEa2sGTmteWlwklL9PgF72xAo

To claim this, I am signing this object:

@jensendarren
jensendarren / VueJS Rapid Prototyping Example
Created February 11, 2020 07:40
A basic VueJS Rapid Prototyping Example
<!--Make sure to install @vue/cli-service-global first-->
<!--Serve this up using `vue serve` at the command line-->
<!--Details here: https://cli.vuejs.org/guide/prototyping.html -->
<template>
<h1>Hello {{name}}</h1>
</template>
<script>
export default {
data() {
@jensendarren
jensendarren / App.vue
Last active February 25, 2020 09:26
A VueJS Prototype for logging console output to the component
<!--Make sure to install @vue/cli-service-global first-->
<!--Serve this up using `vue serve` at the command line-->
<!--Details here: https://cli.vuejs.org/guide/prototyping.html -->
<template>
<div>
<h1>{{name}}</h1>
<b>Logging To Vue Component? <span>{{logging}}</span></b>
<br />
<button @click="testLog">Test Log</button>|<button @click="testWarn">Test Warn</button>|<button @click="toggleLogging">Toggle Logging</button>
<hr/>
@jensendarren
jensendarren / update-keypair-in-ec2.md
Last active February 19, 2020 03:09
Add new SSH Keypair to an EC2 instance when you have lost your .pem file!

How to update your EC2 instance with a new keypair

  1. Create a new keypair in AWS Console

  2. Start a new temporary recovery EC2 instance

  3. Stop the lost keypair instance

  4. Detach the EBS drive from the lost keypair instance

@jensendarren
jensendarren / listNumbersPossibleSum.js
Created July 13, 2020 10:13
Given a list of numbers an a number k, return whether any two number from the list add up to k
/*
Given a list of numbers an a number k, return whether any two number from the list add up to k
For example. given [10,15,3,7] and k of 17 return true sine 10 + 7 is 17.
Bonus can you do in a single pass?
*/
array = [7,15,3,7,8,3,4,100]
k = 23
from decimal import *
#Sets decimal to 10000 digits of precision
getcontext().prec = 10000
def plouffBig(n): #http://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula
pi = Decimal(0)
k = 0
while k < n:
pi += (Decimal(1)/(16**k))*((Decimal(4)/(8*k+1))-(Decimal(2)/(8*k+4))-(Decimal(1)/(8*k+5))-(Decimal(1)/(8*k+6)))
@jensendarren
jensendarren / contracts...Elementary Data Types...BoolType.sol
Created March 11, 2022 01:07
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract BoolType {
bool public aBool;
function notBool() public view returns (bool) {
return !aBool;
}
@jensendarren
jensendarren / contracts...Elementary Data Types...BoolType.sol
Created March 11, 2022 01:20
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract BoolType {
//a basic bool
bool public aBool;
function notBool() public view returns (bool) {
return !aBool;
@jensendarren
jensendarren / contracts...Elementary Data Types...IntegerType.sol
Created March 11, 2022 03:04
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract IntegerType {
// uint type is same as uint256
uint256 aUint;
// int type is same as int256
int256 anInt;