Skip to content

Instantly share code, notes, and snippets.

View th3hunt's full-sized avatar
🎯
Focusing

Stratos Pavlakis th3hunt

🎯
Focusing
  • Blueground
  • Athens
View GitHub Profile
@th3hunt
th3hunt / ProGit.md
Last active August 11, 2023 08:50
Pro Git - A list of Git aliases & recipes to Git like a 😎

Pro Git

A list of Git aliases & recipes to Git like a 😎.

Aliases

# ~/.git/config

[alias]
  # List all aliases :)
  la = "!git config -l | grep alias | cut -c 7-"
@th3hunt
th3hunt / git tutorials.md
Created May 29, 2017 10:48 — forked from jaseemabid/git tutorials.md
Awesome git tutorials I am finding here and there
@th3hunt
th3hunt / jsondiffpatch_chrome_snippet.js
Last active January 10, 2018 21:35
Inject jsondiffpatch + HTML formatter into your page and expose it as diff(obj1, obj2)
if (!window.jsondiffpatch) {
fetch('https://raw.githubusercontent.com/benjamine/jsondiffpatch/master/public/formatters-styles/html.css').then((response) => {
return response.text();
}).then((styles) => {
var css = document.createElement('style');
css.innerText = styles;
document.head.appendChild(css);
});
var script = document.createElement('script');

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@th3hunt
th3hunt / libevent-v-libuv.md
Created March 22, 2017 12:14 — forked from eddieh/libevent-v-libuv.md
libevent vs libuv

libevent vs libuv

Comparing libevent and libuv. My upfront biased: I want to like libevent. However, I want to objectively compare the two and make an informed decision.

What versions are we comparing?

  • libevent 2.0.22 (Stable) [2014-01-05]
  • libuv 1.8.0 (Stable) [2015-12-15]
@th3hunt
th3hunt / megatron.js
Created October 12, 2016 15:12
Megatron
import _ from 'underscore.global';
import Marionette from 'backbone.marionette-1.x';
import React from 'react';
import ReactDOM from 'react-dom';
const defaultModelEvents = 'change';
const defaultCollectionEvents = 'add remove reset';
function defaultGetProps({model, collection, state = {}} = {}) {
if (model) {
@th3hunt
th3hunt / eslintrc.json
Created September 5, 2016 07:27
ESLint configuration
{
"rules": {
"no-console": 1,
"no-duplicate-case": 2,
"no-extra-parens": 0,
"accessor-pairs": 0,
"block-scoped-var": 0,
"complexity": 0,
"default-case": 1,
"guard-for-in": 1,
@th3hunt
th3hunt / backbone.computed.js
Last active April 26, 2016 19:33
A mixin that enables special kind of computed properties on backbone models
/**
* Backbone Computed
* -----------------
*
* a mixin that enables special kind of computed properties on backbone models
*
*
*/
(function (root, factory) {
if (typeof exports !== 'undefined') {
@th3hunt
th3hunt / stickierHeaders.js
Created March 7, 2016 19:02
Stickier Headers - a jQuery plugin prototype
(function($) {
$.fn.stickyHeaders = function({
headerHeight= 60
} = {}) {
const $container = this; // i
const $fakeHeader = $container.find('.fake-header');
$container.on("scroll touchstart touchmove", function() {
const scrollTop = $container.scrollTop();
@th3hunt
th3hunt / onRetina.js
Last active January 28, 2016 12:38
Retina checking function
export default function onRetina() {
if (window.matchMedia) {
var mq = window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 2),' +
'only screen and ( min--moz-device-pixel-ratio: 2),' +
'only screen and ( -o-min-device-pixel-ratio: 2/1),' +
'only screen and ( min-device-pixel-ratio: 2),' +
'only screen and ( min-resolution: 192dpi),' +
'only screen and ( min-resolution: 2dppx)');
return mq ? mq.matches : false
}