Skip to content

Instantly share code, notes, and snippets.

@acrolink
acrolink / my_excel.module.php
Created November 28, 2021 12:14
sms_sender/sites/all/modules/my_excel/my_excel.module [PHP]
View my_excel.module.php
<?php
function my_excel_permission()
{
return array(
'Use Excel API' => array(
'title' => t('Use Excel API'),
'description' => t(''),
),
);
@acrolink
acrolink / borrower_controller.ex
Last active November 28, 2021 12:16
/libsys/backend/mango_web/controllers/borrower_controller.ex [Elixir]
View borrower_controller.ex
defmodule MangoWeb.BorrowerController do
use MangoWeb, :controller
use MangoWeb.ExtendController
alias Mango.Borrowers
alias Mango.Borrowers.Borrower
alias Mango.Repo
import Ecto.Query
@acrolink
acrolink / store.js
Created November 28, 2021 12:05
/libsys/frontend/src/store.js [vue]
View store.js
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import * as Cookies from 'js-cookie'
Vue.use(Vuex)
export default new Vuex.Store({
plugins: [
@acrolink
acrolink / BorrowerForm.vue
Created November 28, 2021 12:01
/libsys/frontend/src/components/BorrowerForm.vue [vue]
View BorrowerForm.vue
<template>
<sweet-modal ref="edit_borrower_modal">
<h2>{{borrower.id != null ? $t('edit_student') : $t('create_new_student')}}</h2>
<div class="form-group">
<label for="editor_name">{{$t('name')}}</label>
<input id="editor_name" v-model="borrower.name" placeholder="" class="form-control">
</div>
<div class="form-group">
View storage.controller.js
'use strict';
var _ = require('lodash');
var Storage = require('./storage.model');
var ProcductLifeCycle = require('../product/product.model').ProductLifeCycle;
var async = require('async');
// Get list of storages
exports.index = function (req, res) {
View product.controller.js
'use strict';
var _ = require('lodash');
var Docxtemplater = require('docxtemplater');
var ImageModule = require('docxtemplater-image-module');
var fs = require('fs');
var util = require('util');
var path = require('path');
var async = require('async');
@acrolink
acrolink / index.html
Created March 1, 2018 21:17 — forked from TahaSh/index.html
Reusable Autocomplete-Input Component in Vue 2.1
View index.html
<title>Vue Awesome Autocomplete</title>
<link rel="stylesheet" href="https://unpkg.com/bulma/css/bulma.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<div id="app">
<autocomplete-input
:options="options"
@select="onOptionSelect"
@acrolink
acrolink / index.html.eex
Last active January 4, 2017 11:28
Filtering results in Phoenix using an exposed filters' form
View index.html.eex
<h2>Listing policies</h2>
<form action="/policies" method="get">
<%= select nil, :client_id, @clients, name: 'client_id' %>
<input type="submit" value="Submit">
</form>
<%= pagination_links @page %>
<!-- HTML displaying the data rows -->