Skip to content

Instantly share code, notes, and snippets.

View CodinCat's full-sized avatar
:octocat:
hi

CodinCat CodinCat

:octocat:
hi
View GitHub Profile
@CodinCat
CodinCat / slim-redux.js
Created March 20, 2017 08:02 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@CodinCat
CodinCat / deep-clone.js
Created August 15, 2016 08:31
Deep clone
function deepClone(obj) {
if (Array.isArray(obj))
return obj.map((el) => deepClone(el))
if (
typeof obj !== 'object' ||
Object.prototype.toString.call(obj) !== '[object Object]' ||
obj === null
)
return obj
body {
font-family: Roboto;
font-size: 15px;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
.issue-summary {
font-size: 16px;
}
.issue-summary_fsi {
@CodinCat
CodinCat / github-style.css
Last active June 18, 2016 14:03
My custom github stylesheet for better readability. Stylish extension: https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe Fira Mono font: https://mozilla.github.io/Fira/
td {
tab-size: 4;
}
body, .markdown-body {
font-family: Roboto;
-webkit-font-smoothing: antialiased;
}
pre,code, .markdown-body .highlight pre, .markdown-body pre, .blob-code-inner, .ace_editor.ace-github-light {
@CodinCat
CodinCat / git_force_update.md
Last active August 29, 2015 14:04
Git force update and override everything from remote

Just take a note.

This will force update a local repository from a remote, and keep only 1 commit history.

git fetch {{remote}} {{branch}} --depth=1
git reset --hard FETCH_HEAD
git clean -df
@CodinCat
CodinCat / Phalcon+WebFaction.md
Last active June 17, 2019 12:51
Install Phalcon on WebFaction host

How to install Phalcon on WebFaction

http://www.webfaction.com/

WebFaction is a great hosting service for everyone, it's as easy as shared hosting, and as powerful as VPS. SSH is allowed, and built in git, so you can install anything you want.

WebFaction uses CentOS 64bit, here is the installation guide with PHP 5.5

body{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxo