Skip to content

Instantly share code, notes, and snippets.

View dahoba's full-sized avatar

Siritas S dahoba

View GitHub Profile
@dahoba
dahoba / tomcat-service_template
Last active August 29, 2015 14:02
tomcat init.d script
#!/bin/bash
#
# Tomcat 7 start/stop/status script
# Forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <[email protected]>
#
# Release updates:
# Updated method for gathering pid of the current proccess
# Added usage of CATALINA_BASE
# Added coloring and additional status
@dahoba
dahoba / gist:68119dd3831805c6c809
Created August 18, 2014 17:02
Angularjs custom filter: Title Case
app.filter('titlecase', function() {
return function(input, scope) {
var result ='';
if (input != null && input != undefined){
var words = input.split(' ');
for(var i=0;i<words.length; i++){
result = result.concat(words[i].substring(0,1).toUpperCase() + words[i].substring(1)+' ');
}
}
return result;
@dahoba
dahoba / ptest.js
Created April 21, 2015 04:28
Testing Closure Compiler Externs Extractor
/* Namespace */
var ProTag = (function() {
var dpiId = eval('__dpi' + new Date().getTime());
$('<div id=&quot;test&quot; >&nbsp;</div>').appendTo('body');
$('<div id=&quot;'+dpiId+'&quot; style=&quot;width:1in;height: 1in;display: none;&quot;></div>').appendTo('body');
var dpi = $('#'+dpiId).width();
$('#'+dpiId).remove();
return {
@dahoba
dahoba / slate-config.note
Created August 27, 2015 04:32
Slate config on my machine
# This is the .slate file for sinb-56-001 and samsung 22"
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config windowHintsIgnoreHiddenWindows false
# Monitor Aliases
# Find your config from System >Preferences >Display >Resolution >Scaled
alias mon-laptop 1280x800
@dahoba
dahoba / .gitignore
Last active November 19, 2016 07:27
Git ignore for Ionic framework (from generated project of Ionic2)
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
@dahoba
dahoba / .gitattribute
Created November 19, 2016 07:32
Git attribute to deal with cross-platform line endings (Linux, macOS, Window)
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c eol=crlf
*.h eol=crlf
*.cpp eol=crlf
*.rc eol=crlf
*.vcproj eol=crlf
@dahoba
dahoba / FOO.xml
Created November 27, 2016 14:44
Tomcat Oracle JNDI datasource sample
<?xml version='1.0' encoding='utf-8'?>
<!-- The contents of this file will be loaded for each web application -->
<!-- this file placed under TOMCAT6_HOME/conf/Catalina/localhost/ -->
<Context path="/FOO" reloadable="false" docBase="FOO" >
<Resource auth="Container" name="jdbc/FOODB"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
password="foobar" maxIdle="8" maxWait="15000" maxActive="16"
removeAbandoned="true" validationQuery="select 1 from dual"
@dahoba
dahoba / angularClass-ng2-webpack2-bootstrap4-fontawesome4_setup.md
Last active November 30, 2016 07:00
AngularClass's Angular2, webpack, Bootstrap4, FontAwesome4 setup

AngularClass's Angular2, Webpack2, Bootstrap4, FontAwesome4 setup

Installation

# Bootstrap 4
npm install --save-dev [email protected]

# Node SASS & other loaders needed to handle styles
npm install --save-dev css-loader node-sass resolve-url-loader sass-loader style-loader url-loader postcss-loader
@dahoba
dahoba / LICENSE
Created December 22, 2016 09:10 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@dahoba
dahoba / settings.json
Created June 13, 2017 02:29
VS Code user settings on macOS
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Inconsolata",
"editor.fontWeight": "normal",
"editor.fontSize": 14,
"editor.lineHeight": 0,
"editor.insertSpaces": true,
"editor.rulers": [
120,
200