Skip to content

Instantly share code, notes, and snippets.

🐦
fly like a bird ...

Kcko

View GitHub Profile
@Kcko
Kcko / bitwise-permission-checking.php
Created Mar 22, 2019 — forked from phnah/bitwise-permission-checking.php
Check permission using bitwise operators
View bitwise-permission-checking.php
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 Mar 8, 2019 — forked from paramburu/headings.scss
Sass recursive headings function (h1, h2, h3...)
View headings.scss
// 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 Jan 18, 2019 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@Kcko
Kcko / mixins.scss
Created Dec 12, 2018 — forked from jpblancoder/mixins.scss
IE 11 - CSS Grid - SASS mixins
View mixins.scss
// 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...) {
@Kcko
Kcko / betterxml.function.php
Created Oct 21, 2018 — forked from Jonathonbyrd/betterxml.function.php
Extending the SimpleXMLElement
View betterxml.function.php
<?php
/**
* Giving myself more functionality over this bit
*
* @author byrd
*
*/
class BetterXML extends SimpleXMLElement
{
/**
@Kcko
Kcko / curl.md
Created Oct 8, 2018 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Kcko
Kcko / DateTime.php
Last active May 25, 2018 — forked from 66Ton99/DateTime.php
DateTime
View DateTime.php
<?php
namespace MyNamespace;
$date = new ADateTime('2018-03-28');
$date->sub(new \DateInterval('P1M'));
echo $date->format('Y-m-d') . "\n";
@Kcko
Kcko / jQuery.stringify.js
Created May 11, 2018 — forked from chicagoworks/jQuery.stringify.js
jQuery.stringify() utility
View jQuery.stringify.js
/**
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
* UPDATES:
* Added a fix to skip over Object.prototype members added by the prototype.js library
* USAGE:
* jQuery.ajax({
@Kcko
Kcko / Com.latte
Created Apr 17, 2018 — forked from Kedrigern/Com.latte
Nette: Ajaxové ovládání komponenty
View Com.latte
{* Component template *}
<div style="border-style: solid; border-width: 1px;">
<h4>Komponenta</h4>
<p>Jméno komponenty: {$control->name}</p>
{snippet com}
<p>Čas vykreslení:{$time|date:'%H:%M:%S'}</p>
{/snippet}
<p><a n:href="refresh!" class="ajax">REFRESH (invalidování)</a></p>
</div>
You can’t perform that action at this time.