Skip to content

Instantly share code, notes, and snippets.

Avatar
🐦
fly like a bird ...

Kcko

🐦
fly like a bird ...
View GitHub Profile
@Kcko
Kcko / splice-object-array.js
Created Mar 6, 2020 — forked from scottopolis/splice-object-array.js
Remove object from array of objects in Javascript
View splice-object-array.js
// source: http://stackoverflow.com/questions/16491758/remove-objects-from-array-by-object-property
// we have an array of objects, we want to remove one object using only the id property
var apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}];
// get index of object with id:37
var removeIndex = apps.map(function(item) { return item.id; }).indexOf(37);
// remove object
apps.splice(removeIndex, 1);
View jquery.plugin_pattern.js
/*
* Project:
* Description:
* Author:
* License:
*/
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function ( $, window, document, undefined ) {
@Kcko
Kcko / singleton.js
Last active Feb 28, 2020 — forked from mateuszwrobel/singleton.js
JS: patterns Singleton
View singleton.js
var mySingleton = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
@Kcko
Kcko / meta-tags.md
Created Feb 24, 2020 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@Kcko
Kcko / FooForm.latte
Created Feb 11, 2020 — forked from medhi/FooForm.latte
Formulář jako komponenta s vlastní šablonou / Form as a component with its own template
View FooForm.latte
{form myForm}
<div class="form-group">
{label book class => 'control-label'/}
{input book class => form-control}
</div>
<div class="form-group">
{input send class => 'btn btn-primary'}
</div>
{/form}
@Kcko
Kcko / iteration-and-recursive-iteration.php
Last active Jan 31, 2020 — forked from hakre/iteration-and-recursive-iteration.php
Iteration and Recursive Iteration Examples Code
View iteration-and-recursive-iteration.php
<?php
/*
* Iteration and Recursive Iteration Examples Code
*
* @link http://stackoverflow.com/questions/12077177/how-does-recursiveiteratoriterator-works-in-php
* @author hakre <http://hakre.wordpress.com>
*/
### To have these examples to work, a directory with subdirectories is needed,
### I named mine "tree":
@Kcko
Kcko / nodejs-cheatsheet.js
Last active Nov 29, 2019 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View nodejs-cheatsheet.js
/* *******************************************************************************************
* 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 Nov 29, 2019 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
View xpath-cheatsheet.js
// 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 Oct 23, 2019 — forked from rob-kistner/mixin-asset-helper.scss
sass mixin: Asset Helper Function
View mixin-asset-helper.scss
/// 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
You can’t perform that action at this time.