Skip to content

Instantly share code, notes, and snippets.

View relaxedtomato's full-sized avatar

Ram relaxedtomato

View GitHub Profile
@relaxedtomato
relaxedtomato / default.md
Created July 8, 2025 19:17 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
{
"window.zoomLevel": 0,
"editor.minimap.enabled": false,
"editor.tabSize": 2,
"workbench.settings.editor": "json",
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
@relaxedtomato
relaxedtomato / js-betting-game.html
Last active December 27, 2024 01:25 — forked from Leejojo/js-betting-game
js-betting-game
<!DOCTYPE html>
<html>
<head>
<script src="jquery-3.1.0.js"></script>
</head>
<body>
<h1>Place Your Bets!</h1>
<!--RB: You can remove this extra space, lint takes care of this, http://eslint.org/-->
@relaxedtomato
relaxedtomato / CombineReducers.md
Created June 28, 2016 02:01
Combine Reducers
import { combineReducers } from 'redux'

function todos(state = [], action) {
  switch (action.type) {
    case ADD_TODO:
      return [
        ...state,
 {
const initialState = {
  visibilityFilter: VisibilityFilters.SHOW_ALL,
  todos: []
}

function todoApp(state = initialState, action) {
  switch (action.type) {
    case SET_VISIBILITY_FILTER:
 return Object.assign({}, state, {

The classic example of a reducer is doing a sum:

const result = [1,2,3].reduce((acc,value) => acc+value, 0);
// result is 6
console.log(result);

jsbin

However, the result of the reducer does not need to be the same type of the items in the collection. For example:

var game = {
userAmount: 100,
bet: null,
number: null,
guess: null,
getBetAmount: function() {
//RB: Question - what does 'this' refer to? Do look up the different rules for 'this' (we can discuss further next time).
//RB: The approach to using this is not wrong, however, you can also just refer to globally defined variables (to reduce writing 'this')
@relaxedtomato
relaxedtomato / candidates.rb
Last active April 29, 2016 00:46 — forked from joshuastr/candidates.rb
Candidates
require 'active_support/all'
@candidates = [
{
id: 5,
years_of_experience: 4,
github_points: 293,
languages: ['C', 'Ruby', 'Python', 'Clojure'],
date_applied: 5.days.ago.to_date,
age: 26
@relaxedtomato
relaxedtomato / css
Created April 8, 2016 18:00
flexbox
.parent {
width: 100%;
height: 350px;
outline: 1px solid black;
display: flex;
flex-direction: row;
justify-content: space-around;
/* align-items: baseline; */
/* flex-wrap: wrap-reverse; */
flex-flow: row nowrap;
@values = [
[1000, 'M'],
[500, 'D'],
[100, 'C'],
[50, 'L'],
[10, 'X'],
[5, 'V'],
[1, 'I']
]