Skip to content

Instantly share code, notes, and snippets.

@jacob-faber
jacob-faber / Git.md
Last active November 23, 2015 20:43
Git cheatsheet

Git cheatsheet

Setup

git config --global user.name <name>
git config --global user.email 
@jacob-faber
jacob-faber / manifest.json
Last active November 30, 2015 15:45
Chrome renamer Extension
{
"manifest_version": 2,
"name": "Extension name",
"description": "Description",
"version": "1.0",
"content_scripts": [
{
"matches": [
"https://www.seznam.cz/"
],
@jacob-faber
jacob-faber / async-parallel-right.js
Last active December 4, 2015 05:55
Working with asynchronous functions
var db = {
// Async function 1
findUsers: function (callback) {
setTimeout(function () {
console.log('findUsers()');
callback([
{name: 'Jacob', age: 22},
{name: 'Michaela', age: 21}
])
@jacob-faber
jacob-faber / index.js
Last active February 4, 2016 15:04
Base Functions in functional programming (without error checking for brevity)
'use strict';
const expect = require('chai').expect;
const array1 = [1, 2, 3];
const array2 = [1];
const array3 = [];
// Let's define fundamental building block
@jacob-faber
jacob-faber / intellij.md
Last active June 12, 2018 11:09 — forked from uarun/intellij.md
Intellij IDEA - Cheat Sheet (aka useful shortcuts) #idea

Intellij IDEA - Cheat Sheet (aka most useful shortcuts)

Note: Some of these keymapping are specific to IdeaVim plugin. If you don't use IdeaVim (what' wrong with you :)), I've tried to point out where they differ, but I could have missed a few

Coding Session

Parameter documentation for Method Calls

  • Ctrl-P - Popup parameter documentation for method calls
class Player {
public:
Player();
virtual void who() = 0;
};
class HumanPlayer: public Player {
void who() { ... };
};
"https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java
imap jk <Esc>
let mapleader = "j"
map <leader>g :action GotoLine<CR>
map <leader>f :action Find<CR>
map <leader>F :action FindInPath<CR>
map <leader>h :action CallHierarchy<CR>
map <leader>i :action ImplementMethods<CR>
map <leader>o :action MethodHierarchy.OverrideMethodAction<CR>
from itertools import product
from functools import lru_cache
import time
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
@jacob-faber
jacob-faber / main.c
Last active March 28, 2016 01:01
COPY & MOVE Semantics
#include <iostream>
using namespace std;
class A {
public:
A(int id) : id(id) {
cout << "CONSTRUCTOR ID" << endl;
}
@jacob-faber
jacob-faber / webpack.config.js
Last active March 30, 2016 16:39
Webpack debugger setup in Webstorm 11
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./src/index'
],