Skip to content

Instantly share code, notes, and snippets.

View ajtran303's full-sized avatar
🔥

AJ Tran ajtran303

🔥
View GitHub Profile
@jcasimir
jcasimir / .gitignore
Last active March 1, 2024 08:01
Running all MiniTest Tests with SimpleCov
test/coverage/
class Bob
def reply_to(statement)
public_send("reply_to_#{statement.class}".downcase.to_sym)
rescue NoMethodError
default_reply
end
def reply_to_silence
"Fine. Be that way!"
end
@rmm5t
rmm5t / bob.rb
Last active April 9, 2020 02:06
class Bob
def respond_to(input)
@input = input.strip
return "Fine. Be that way!" if silence?
return "Whoa, chill out!" if shouting?
return "Sure." if question?
"Whatever."
end
@aparrish
aparrish / csv-intro.ipynb
Last active July 18, 2023 20:00
Quick intro to CSVs. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@missating
missating / blog-routes.txt
Last active March 5, 2023 09:25
Blog routes table showing the 7 different route for my medium post Restful routes
| NAME | PATH | HTTP VERB | PURPOSE |
|----------|----------------|-----------------|--------------------------------------|
| Index | /blog | GET | Displays all blog post |
| New | /blog/new | GET | Shows new form for new blog entry |
| Create | /blog | POST | Creates a new blog post |
| Show | /blog/:id | GET | Shows one specified blog post |
| Edit | /blog/:id/edit | GET | Shows edit form for one blog post |
| Update | /blog/:id | PUT | Updates a particular blog post |
| Destroy | /blog/:id | DELETE | Deletes a particular blog post |
@gaearon
gaearon / modern_js.md
Last active July 18, 2024 10:37
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@ismith
ismith / cc.png
Last active January 19, 2021 23:43
Dark's caption embedding script
cc.png
@iandouglas
iandouglas / README.md
Last active March 21, 2024 12:44
Intro to Co-Authored Git Commits

Intro to Co-Authored Git Commits

Why

In student projects, I commonly look at contribution graphs to see how much code they worked on, to get an idea if one student is doing more work than others on the project. This can be used for coaching and performance grading.

How

Start with your ~/.gitconfig file in your home folder. Add these lines:

@rwarbelow
rwarbelow / command_prompt.md
Last active June 2, 2023 04:21
Changing Your Command Prompt

First, make sure you're at the home directory by typing cd.

Next, type nano .bash_profile. Copy and paste this into the window:

# get current branch in git repo
function parse_git_branch() {
  BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
  if [ ! "${BRANCH}" == "" ]
 then