Skip to content

Instantly share code, notes, and snippets.

@kongondo
kongondo / .gitignore
Created October 18, 2020 09:38 — forked from hieblmedia/.gitignore
Gitignore - Exclude all except specific subdirectory
#
# If all files excluded and you will include only specific sub-directories
# the parent path must matched before.
#
/**
!/.gitignore
###############################
# Un-ignore the affected subdirectory
/**
* Validates hex value
* @param {String} color hex color value
* @return {Boolean}
*/
function isValidHex(color) {
if(!color || typeof color !== 'string') return false;
// Validate hex values
if(color.substring(0, 1) === '#') color = color.substring(1);
@kongondo
kongondo / CKEditor.vue
Created May 28, 2020 04:14 — forked from pi0/CKEditor.vue
CKEditor
<!-- Based on https://github.com/dangvanthanh/vue-ckeditor -->
<template>
<div class="ckeditor">
<textarea :id="id" :value="value"></textarea>
</div>
</template>
<style scoped>
.ckeditor {
@kongondo
kongondo / currency_list
Created January 13, 2020 12:05 — forked from champsupertramp/currency_list
World Currency list in PHP Array
array (
'ALL' => 'Albania Lek',
'AFN' => 'Afghanistan Afghani',
'ARS' => 'Argentina Peso',
'AWG' => 'Aruba Guilder',
'AUD' => 'Australia Dollar',
'AZN' => 'Azerbaijan New Manat',
'BSD' => 'Bahamas Dollar',
'BBD' => 'Barbados Dollar',
'BDT' => 'Bangladeshi taka',
@kongondo
kongondo / parsce-csv-test.js
Created November 15, 2019 11:12 — forked from atomkirk/parsce-csv-test.js
parse csv with javascript
import parseCsv from 'zipbooks/utils/parse-csv'
import { module, test } from 'qunit'
module('Unit | Utility | parse-csv', function(_hooks) {
test('parses csv successfully', function(assert) {
let result = parseCsv('name,age\nadam,31\ntim,32\n"St, clair",26')
assert.equal(JSON.stringify(result), '[["name","age"],["adam","31"],["tim","32"],["St, clair","26"]]')
})
@kongondo
kongondo / vue.json
Created September 26, 2019 12:03 — forked from rochabianca/vue.json
Snippet to bring back scaffold on vue on vscode. To use it go to Code>Preferences>User Snippets type vue on the input and paste this code there.
{
"bring back the scaffold to vue files": {
"prefix": "scaffold",
"body": [
"<template>",
" <div>$TM_FILENAME_BASE</div>",
"</template>",
"",
"<script>",
"export default {",
@kongondo
kongondo / .block
Created February 25, 2018 00:16 — forked from mbostock/.block
Multi-Series Line Chart
license: gpl-3.0
@kongondo
kongondo / .block
Created February 22, 2018 16:54 — forked from mbostock/.block
Grouped Bar Chart
license: gpl-3.0
@kongondo
kongondo / BarChart.js
Created February 21, 2018 00:04 — forked from ThomasBurleson/BarChart.js
Reusable Chart component for D3 - using prototypes and factories
(function() {
// Based on article @ http://www.toptal.com/d3-js/towards-reusable-d3-js-charts
// Publish a factory method for Chart instances
// @usage:
// var runningChart = BarChart.instanceOf( {barPadding : 2 } );
// var weatherChart = BarChart.instanceOf()
// .fillColor('coral');
window.BarChart = {