Skip to content

Instantly share code, notes, and snippets.

View ianfabs's full-sized avatar

Ian Fabs ianfabs

View GitHub Profile
@ianfabs
ianfabs / db.js
Last active April 9, 2019 16:54
A really really REAAAALLLY tiny DB I made for testing things, works great with graphql apis :-)
// Do not use this class yet, please just use the Collection class
class DB {
constructor(collections) {
if (
collections !== null &&
collections !== undefined &&
collections !== []
) {
//this._db = collections.map((s, i) => ({ ...s, id: i }));
if (collections instanceof Object) {
@ianfabs
ianfabs / jgraph.ts
Created October 22, 2018 04:18
jgraph: a simple typescript-based fetch api for GraphQL, to make it a bit easier to use semantically
interface JraphOptions{
url: string;
method: "post" | "POST" | "get" | "GET" | "put" | "PUT" | "delete" | "DELETE";
query: string;
}
async function jraph(argv: JraphOptions){
let url = argv.url;
let headers = { 'Content-Type': 'application/json' }
let body = JSON.stringify({query: argv.query});
@Rohithyeravothula
Rohithyeravothula / The Technical Interview Cheat Sheet.md
Last active September 18, 2018 18:16 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@Arham4
Arham4 / data.yaml
Last active September 20, 2023 01:26
Easy Jackson YAML Parsing with Kotlin
username: "Test"
password: "123456"
@JonathanMH
JonathanMH / index.js
Created October 22, 2016 15:07
JSON Web Token Tutorial: Express
// file: index.js
var _ = require("lodash");
var express = require("express");
var bodyParser = require("body-parser");
var jwt = require('jsonwebtoken');
var passport = require("passport");
var passportJWT = require("passport-jwt");
@wojteklu
wojteklu / clean_code.md
Last active April 18, 2024 14:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@acamino
acamino / README.md
Last active April 5, 2024 19:07
Shortcuts to Improve Your Bash & Zsh Productivity

Shortcut — Action

  • CTRL + A — Move to the beginning of the line
  • CTRL + E — Move to the end of the line
  • CTRL + [left arrow] — Move one word backward (on some systems this is ALT + B)
  • CTRL + [right arrow] — Move one word forward (on some systems this is ALT + F)
  • CTRL + U — (bash) Clear the characters on the line before the current cursor position
  • CTRL + U —(zsh) If you're using the zsh, this will clear the entire line
  • CTRL + K — Clear the characters on the line after the current cursor position
  • ESC + [backspace] — Delete the word in front of the cursor
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 16, 2024 23:05
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"