Skip to content

Instantly share code, notes, and snippets.

View Kcko's full-sized avatar
🦜
fly like a bird ...

Kcko

🦜
fly like a bird ...
View GitHub Profile
@Kcko
Kcko / nodejs-cheatsheet.js
Last active November 29, 2019 09:35 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Kcko
Kcko / bash-cheatsheet.sh
Created November 29, 2019 09:35 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@Kcko
Kcko / mixin-asset-helper.scss
Last active October 23, 2019 19:00 — forked from rob-kistner/mixin-asset-helper.scss
sass mixin: Asset Helper Function
/// Base path for assets (fonts, images...),
/// should not include trailing slash
/// @access public
/// @type String
$asset-base-path: '../assets' !default;
/// Asset URL builder
/// @access private
/// @param {String} $type - Asset type, matching folder name
/// @param {String} $file - Asset file name, including extension
@Kcko
Kcko / gist:397eb5cc0209dd8f52a07ba97593d28e
Created May 3, 2019 19:02 — forked from dundee/gist:1274919
Foreach vs array_reduce
<?php
$arr = array(
array('a', '1'),
array('b', '2'),
);
// klasicky
$out = array();
@Kcko
Kcko / gist:b368919a7cbfb8b120e4cd9766083044
Created April 30, 2019 09:16 — forked from ethanpil/gist:8675160
Insert A Random String from List in MySQL
UPDATE tablename
SET columnname = ELT(0.5 + RAND() * 6, 'value 1','value 2','value 3','value 4','value 5','value 6')
@Kcko
Kcko / bitwise-permission-checking.php
Created March 22, 2019 18:25
Check permission using bitwise operators
Initially, I found bitmasking to be a confusing concept and found no use for it. So I've whipped up this code snippet in case anyone else is confused:
<?php
// The various details a vehicle can have
$hasFourWheels = 1;
$hasTwoWheels = 2;
$hasDoors = 4;
$hasRedColour = 8;
@Kcko
Kcko / headings.scss
Last active March 8, 2019 19:13 — forked from paramburu/headings.scss
Sass recursive headings function (h1, h2, h3...)
// orig source: https://guwii.com/bytes/sass-function-loop-headings-h1h2h3h4h5h6/
@function headings($from:1, $to:6) {
@if $from == $to {
@return 'h#{$from}';
} @else {
@return 'h#{$from},' + headings($from+1, $to);
}
}
@Kcko
Kcko / README.md
Last active January 18, 2019 18:50 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@Kcko
Kcko / mixins.scss
Created December 12, 2018 12:45
IE 11 - CSS Grid - SASS mixins
// Ensure CSS grid works with IE 11 spec.
// https://css-tricks.com/browser-compatibility-css-grid-layouts-simple-sass-mixins/
// sass-lint:disable no-vendor-prefixes, no-duplicate-properties
@mixin display-grid {
display: -ms-grid;
display: grid;
}
// $columns values should be delimited by a space
@mixin grid-template-columns($columns...) {