Skip to content

Instantly share code, notes, and snippets.

View joemocha's full-sized avatar
🎯
Focusing

joemocha

🎯
Focusing
View GitHub Profile
@joemocha
joemocha / README_MINIMAL_PROMPT_CHAINABLE.md
Created July 7, 2024 16:31 — forked from disler/README_MINIMAL_PROMPT_CHAINABLE.md
Minimal Prompt Chainable for zero library sequential prompt chaining

Minimal Prompt Chainable

Sequential prompt chaining in one method with context and output back-referencing.

Files

  • main.py - start here - full example using MinimalChainable from chain.py to build a sequential prompt chian
  • chain.py - contains zero library minimal prompt chain class
  • chain_test.py - tests for chain.py, you can ignore this
  • requirements.py - python requirements

Setup

@joemocha
joemocha / machine.js
Created September 13, 2019 05:07
Generated by XState Viz: https://xstate.js.org/viz
const orderStateMachine = Machine({
id: 'state',
initial: 'CREATED',
states: {
CREATED: {
on: {
AUTHORIZE: 'AUTHORIZED',
PAYMENT_FAIL: 'PAYMENT_FAILED',
},
},

Keybase proof

I hereby claim:

  • I am joemocha on github.
  • I am joemocha (https://keybase.io/joemocha) on keybase.
  • I have a public key ASBIHZyRO3-dQk0oE1BID728Pf_GWnIi5RGBDzXG0SoGjQo

To claim this, I am signing this object:

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@joemocha
joemocha / index.md
Created September 22, 2016 13:04 — forked from alekseykulikov/index.md
SUIT CSS naming convention for React.js application

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 6561 lines of CSS (and just 5 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

getActions(cellData, cellDataKey, rowData, rowIndex) {
if(!rowData['return_invoice_id'] && rowData['days_left'] > 0){
return <a style={this.styles.link} href={"/return_funnel/filtered_purchases?vin_number="+rowData['vin']+"&filter_type=vin_number_filter"}>Return Vehicle</a>
} else if (!rowData['return_invoice_id']){
return '';
} else {
return this.getVraLink(rowData);
}
}
{
status: 201,
data: [
{ id: 12345, name: "foo" }
]
}
{
status: 400,
message: [
"Name is missing",
"ID is missing",
]
}
@joemocha
joemocha / cors.nginxconf
Created November 2, 2015 17:42 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {