Skip to content

Instantly share code, notes, and snippets.

daGo dagolinuxoid

Block or report user

Report or block dagolinuxoid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dagolinuxoid
dagolinuxoid / implicitTbody.js
Created Jan 25, 2019
presence of an implicit tbody in html
View implicitTbody.js
// this code will NOT produce implicit tbody tag in your html
let table = document.createElement('table');
let tr = document.createElement('tr');
let td = document.createElement('td');
td.textContent = 'table Data';
table.append(tr);
tr.append(td);
document.body.append(table);</code>
"resultingHTML is: <table><tr><td>table Data</td></tr></table>";
View decorator.js
let worker = {
slow(min, max) {
return min + max; // scary CPU-hogger is assumed
}
};
function cachingDecorator(fn){
const makeKey = input => String(input);
let cache = {};
return function wrap(...args) {
@dagolinuxoid
dagolinuxoid / letScope.js
Created Apr 24, 2018
#beCareful #let #var #scope #kata
View letScope.js
https://www.codewars.com/kata/give-me-a-diamond/train/javascript
// doesn't work!
function diamond(n){
if (n<=0 || n%2===0) return null;
function buildLine() {
let spaces = ' '.repeat((n-i)/2);
let stars = '*'.repeat(i);
return spaces+stars+'\n';
}
const mid = '*'.repeat(n)+'\n';
@dagolinuxoid
dagolinuxoid / settings.json
Created Apr 9, 2018
visual studio code | my_config | ~/.config/Code/User/settings.json
View settings.json
{
"workbench.activityBar.visible": true,
"workbench.statusBar.visible": true,
"window.zoomLevel": 0,
"editor.fontFamily": "Hack", // "Liberation Mono"
"editor.fontSize": 14,
"editor.minimap.enabled": false,
"files.associations": {
"*.html": "html"
},
@dagolinuxoid
dagolinuxoid / preptoHaskellScanL.js
Created Mar 8, 2018
bicycles | proto | examples | eazy-breezy
View preptoHaskellScanL.js
//polyfil map == transformer
Array.prototype.transformer = function (callback) {
const transformedArr = [];
for (let i=0; i<this.length; i++) {
transformedArr.push(callback(this[i],i,this));
}
return transformedArr;
};
var numbers = [1,2,3,4,5];
View HowIApproachedIt .js
//PS. twenty-five is more common then twenty five I belive, so I used dash.
const apm=(num)=>num<12?'AM':'PM';
const hh=(num)=>{
const ones=['twelve','one','two','three','four','five','six','seven','eight','nine','ten','eleven'];
return ones[num%12];
};
const mm=(num)=>{
if(num==='00') return '';
@dagolinuxoid
dagolinuxoid / GitHub-Forking.md
Last active Oct 24, 2017 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow
View GitHub-Forking.md

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to collate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or ju

@dagolinuxoid
dagolinuxoid / dago.vim
Created Oct 19, 2017
color scheme for neo
View dago.vim
" What should I do ?
hi clear
let colors_name="dago"
" BASE "
""hi Normal ctermfg=251 ctermbg=8
" Elegant highlighting on matching (){}[]
hi MatchParen cterm=bold ctermfg=red ctermbg=none
View init.vim
" ~/.config/nvim/init.vim
3
2 " ~/.local/share/nvim/site/pack/git-plugins/start
1
5 " Colorscheme ^^
1 colorscheme dago
2
3 " self-explanatory
4 syntax on
5 set number
@dagolinuxoid
dagolinuxoid / keybindings.json
Created Sep 19, 2017
vs code | keybindings.json
View keybindings.json
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "ctrl+h", "command": "cursorLeft",
"when": "editorTextFocus" },
{ "key": "ctrl+j", "command": "cursorRight",
"when": "editorTextFocus" },
{ "key": "ctrl+u", "command": "cursorUp",
"when": "editorTextFocus" },
{ "key": "ctrl+l", "command": "cursorDown",
"when": "editorTextFocus" },
You can’t perform that action at this time.