Skip to content

Instantly share code, notes, and snippets.

View diverted247's full-sized avatar

Ted Patrick diverted247

View GitHub Profile
@diverted247
diverted247 / Arrow.vue
Created February 25, 2016 17:21
Vue SVG Arrow component
<template lang="i18n">
<svg xmlns="http://www.w3.org/2000/svg" :width.once="width" :height.once="height" viewBox="0 0 8 13">
<path d="M6.4 12.7L.3 6.5 6.4.2l1.3 1.3-4.9 5 4.9 4.9z" :transform.once="'rotate('+rotation+')'" :fill="color"/>
</svg>
</template>
<script>
export default {
data: function(){
return {};
@diverted247
diverted247 / test.js
Created December 17, 2015 17:26
Intern Test JS file
define(function (require) {
var registerSuite = require('intern!object');
var assert = require('intern/chai!assert');
registerSuite({
name: 'index',
'greeting form': function () {
return this.remote
.get(require.toUrl('index.html'))
@diverted247
diverted247 / 1_use
Created December 10, 2015 14:39
Vuejs IconArrow Component
<div>
<iconarrow rotate="90" color="#FF0000"/>
<iconarrow rotate="45" color="#00FF00"/>
<iconarrow rotate="180" color="#0000FF"/>
</div>
@diverted247
diverted247 / sample.html
Created November 24, 2015 14:18
Center align column in Pure css
<div class="pure-g">
<div class="pure-u-1-1" style="max-width:1200px;margin-left:auto;margin-right:auto">
Center
</div>
</div>
@diverted247
diverted247 / gulpfile.js
Created November 23, 2015 19:23
env - environment task to test against engine in package.json and one executing
var gulp = require('gulp');
var validatenv = require('validate-node-version')();
gulp.task( 'env' , function (){
if( !validatenv.satisfies ){
console.error(validatenv.message);
process.exit(1);
}
});
@diverted247
diverted247 / Sample.vue
Created November 22, 2015 16:24
ts in .vue files
<template>
<h2>{{msg}}</h2>
</template>
<script lang="ts">
export function data() {
return {
msg: 'Hello from Component AAA!'
};
};
@diverted247
diverted247 / IconArrow.vue
Created November 22, 2015 16:10
Example .vue component writing svg with prop
<template>
<svg xmlns="http://www.w3.org/2000/svg" width="2.5em" height="1em" viewBox="0 0 8 13">
<path d="M6.4 12.7L.3 6.5 6.4.2l1.3 1.3-4.9 5 4.9 4.9z" transform="rotate({{rotation}})" fill="#969696"/>
</svg>
</template>
<script>
export default {
props:{
rotation:{
@diverted247
diverted247 / LogFilter.java
Created November 14, 2015 14:45
Servlet Filter
// Import required java libraries
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
// Implements Filter class
public class LogFilter implements Filter {
public void init(FilterConfig config)
throws ServletException{
@diverted247
diverted247 / vue.config.js
Created November 3, 2015 16:50
Vueify Configuration for TypeScript v0.0.1 (Early)
var ts = require("typescript");
module.exports = {
// register custom compilers
customCompilers: {
// for tags with lang="ts"
ts: function( content , cb ){
var compilerOptions = { module: ts.ModuleKind.CommonJS };
var res = ts.transpileModule( content , { compilerOptions: compilerOptions , moduleName: "" , reportDiagnostics: true } );
@diverted247
diverted247 / README.md
Last active October 30, 2015 20:41
Compiling TypeScript string within Nodejs Including Diagnostics
  • npm install
  • node index.js