Skip to content

Instantly share code, notes, and snippets.

View andevsoftware's full-sized avatar

Andev Software andevsoftware

View GitHub Profile
sudo yum install ruby
sudo yum install rubygems
sudo yum install ruby-devel
sudo gem update --system
sudo gem install compass
@andevsoftware
andevsoftware / 6fbfd5e68d3306e51350bea0232f8fa5.php
Created November 17, 2015 09:35
PHP - Disable/enable maintenance file
<?php
try {
$filename = 'maintenance.enable';
if (file_exists($filename)) {
unlink($filename);
echo "Application is now public";
} else {
@andevsoftware
andevsoftware / .htaccess
Created November 17, 2015 09:37
HTACCESS - Redirect public to maintenance page
# Redirect public to maintenance page
RewriteCond %{DOCUMENT_ROOT}/dist/maintenance.enable -f
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
RewriteRule ^ /maintenance.html [R=301,L]
@andevsoftware
andevsoftware / dataService.factory.ts
Created February 21, 2016 10:29
Create instance of DataService with MemoryDataSource and ApiDataSource
app.factory('dataService', ['$q', 'logger', 'apiService', 'resources', ($q, logger, apiService, resources) => {
var dataService = new App.Services.DataService($q);
dataService.source(new TSCore.App.Data.DataSources.MemoryDataSource($q, logger));
dataService.source(new TSCore.App.Data.DataSources.ApiDataSource($q, apiService, logger));
dataService.setResources(resources);
return dataService;
@andevsoftware
andevsoftware / config.constructor.ts
Last active February 27, 2016 18:46
Create new Config
var config = new TSCore.Config({
application: {
title: 'Project title',
version: '1.1.0'
}
});
@andevsoftware
andevsoftware / config.has.ts
Last active February 27, 2016 18:47
Config - has method
var config = new TSCore.Config({
application: {
title: 'Project title',
version: '1.1.0'
}
});
config.has('application.title');
// true
@andevsoftware
andevsoftware / config.get.ts
Last active February 27, 2016 18:50
Config - get method
var config = new TSCore.Config({
application: {
title: 'Project title',
version: '1.1.0'
}
});
config.get('application.title');
// 'Project title'
@andevsoftware
andevsoftware / config.set.ts
Last active February 27, 2016 18:49
Config - set method
var config = new TSCore.Config();
config.set('application.repository', 'https://github.com/redound/ts-core.git');
config.get();
//{
// application: {
// repository: "https://github.com/redound/ts-core.git"
// }
@andevsoftware
andevsoftware / config.load.ts
Last active February 27, 2016 18:47
Config - load method
var config = new TSCore.Config({
application: {
title: 'Project title',
version: '1.1.0'
}
});
config.load({ application: { title: 'Project title', version: '1.2.0' } });
config.get('application.version');
@andevsoftware
andevsoftware / config.clear.ts
Last active February 27, 2016 18:52
Config - clear method
var config = new TSCore.Config({
application: {
title: 'Project title',
version: '1.1.0'
}
});
config.clear();
config.get();