Skip to content

Instantly share code, notes, and snippets.

View CKEditor.vue
<!-- 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 Jan 13, 2020 — forked from champsupertramp/currency_list
World Currency list in PHP Array
View currency_list
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 / menu-builder-getmenuitems-show-more.php
Last active Dec 17, 2019
Example Menu Builder 'Show More' Recursive Menu
View menu-builder-getmenuitems-show-more.php
<?php
/**
* Builds a nested list (menu items) of a single menu.
*
* A recursive function to display nested list of menu items.
*
* @param integer $parent ID of menu item to start build.
* @param WireArray $menu WireArray Object of menu items to display.
* @param integer $first Helper variable to designate first menu item and <ul></ul>.
@kongondo
kongondo / parsce-csv-test.js
Created Nov 15, 2019 — forked from atomkirk/parsce-csv-test.js
parse csv with javascript
View parsce-csv-test.js
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 Sep 26, 2019 — 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.
View vue.json
{
"bring back the scaffold to vue files": {
"prefix": "scaffold",
"body": [
"<template>",
" <div>$TM_FILENAME_BASE</div>",
"</template>",
"",
"<script>",
"export default {",
View UIkit-sortable-javascript.markdown
@kongondo
kongondo / restrict-same-user-session.php
Last active Oct 1, 2018
ProcessWire: Restrict logins for users so that one user cannot be loggedin in more than once simultaneously
View restrict-same-user-session.php
<?php namespace ProcessWire;
// code goes in ready.php
// Hook into login/logout sessions
wire()->addHookAfter('Session::loginSuccess', null, 'checkLoggedIn');
wire()->addHookBefore('Session::logout', null, 'removeLoggedIn');// Hook before to get $user->id
/**
* Check if a user is already logged in
*
* If user logged in, take an action (notify,logout,etc).
@kongondo
kongondo / processwire_api_visual_studio_code_snippets.json
Last active Dec 16, 2018
ProcessWire API Visual Studio Code Snippets
View processwire_api_visual_studio_code_snippets.json
{
"pages->find(\"selector\")": {
"prefix": "pages find(\"selector\")",
"body": [
"\\$${1:pages}->find(\"${2:selector}\");"
],
"description": "Find and return all pages matching the given selector string. Returns a filtered PageArray unless an include mode is specified."
},
"pages->count(\"selector\")": {
"prefix": "pages count(\"selector\")",
@kongondo
kongondo / .block
Created Feb 25, 2018 — forked from mbostock/.block
Multi-Series Line Chart
View .block
license: gpl-3.0
@kongondo
kongondo / .block
Created Feb 22, 2018 — forked from mbostock/.block
Grouped Bar Chart
View .block
license: gpl-3.0
You can’t perform that action at this time.