git status
git diff // diff working_dir vs last_commit
git log
git log --graph // visualize graph topology in terminal
gitk // visualize graph topology in gitk (GUI)
git add . // stage new & modified files, without deleted
git add -u // stage modified & deleted files, without new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === Program | |
class Main | |
def compare(n1, n2) | |
(n1 + n2).to_i > (n2 + n1).to_i | |
end | |
def special_sort(arr) | |
result = [] | |
temp = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === Program v1 [time complexity: O(n^2)] | |
class Main | |
def equilibrium_index(arr) | |
result = [] | |
arr.each_with_index do |el, i| | |
j = 0 | |
sum_prefix = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === [Lesson 2: Arrays] - CyclicRotation | |
# === Program v1 (recursive) | |
def solution(a, k) | |
return a if k == 0 || a.length == 0 | |
a = a.unshift(a.delete_at(a.length - 1)) | |
k -= 1 | |
return solution(a, k) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# custom bash, copied from Vagabond box | |
bind 'set completion-ignore-case on' | |
GIT_PS1_SHOWDIRTYSTATE=1 # displays * or + | |
GIT_PS1_SHOWSTASHSTATE=1 # displays $ | |
GIT_PS1_SHOWUNTRACKEDFILES=1 # displays % | |
GIT_PS1_SHOWUPSTREAM='auto' # displays <, >, <> or = | |
GIT_PS1_SHOWCOLORHINTS=1 | |
GIT_PS1_DESCRIBE_STYLE='contains' | |
RESET="\[\033[0m\]" | |
GRAY="\[\033[38;5;248m\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Adapted from: | |
-- https://gist.github.com/eric-hu/5846890 | |
-- | |
-- Modified to work with files as well, cd-ing to their container folder | |
on run {input, parameters} | |
tell application "Finder" | |
set my_file to first item of input | |
set filetype to (kind of (info for my_file)) | |
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer: | |
-- http://stackoverflow.com/a/6881524/640517 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var app = express() | |
var request = require('request') | |
app.use(require('body-parser').json()) | |
var endpoints = require('./endpoints.json') | |
var response = require('./response.json') | |
app.all("*", function(req, res) { | |
endpoints.forEach(function(ept) { | |
full_url = ept + req.url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/localtunnel/localtunnel/issues/81#issuecomment-218320442 | |
# usage: ruby localtunnel.rb --port 3000 --subdomain yourdomainhere | |
require 'optparse' | |
options = { subdomain: 'defaultdomain', port: 3000 } | |
parser = OptionParser.new do |opts| | |
opts.banner = 'Usage: localtunnel.rb [options]' | |
opts.on('-s', '--subdomain subdomain', 'Subdomain') do |subdomain| |
- File sharing - https://send.firefox.com/
- Video conferencing - https://meet.jitsi.net/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample Component file for reference, because Joey forgets simple stuff. | |
*/ | |
import React from 'react'; | |
import './Sample.scss'; | |
class Sample extends React.Component { | |
constructor(props) { | |
super(props); |
OlderNewer