Skip to content

Instantly share code, notes, and snippets.

xgettext --from-code=utf-8 -k_e -k_x -k__ -o languages/default.pot $(find . -name "*.php")
'use strict';
/**
* This module monitors angularFire's authentication and performs actions based on authentication state.
* directives/directive.ngcloakauth.js depends on this file
*
* Modify ng-cloak to hide content until FirebaseSimpleLogin resolves. Also
* provides ng-show-auth methods for displaying content only when certain login
* states are active.
*
@caasig
caasig / app.js
Last active August 29, 2015 14:15
$http.post like jQuery.post
angular
.module('myHttpDecorator', [])
.config(function ($provide) {
/*!
* Decorate $http with method to post as form data
* Based on http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/
*/
$provide.decorator('$http', function ($delegate) {
$delegate.postAsForm = function (url, data, config) {
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@caasig
caasig / gist:80365989368b5b8fe12c
Created June 8, 2015 04:07
.htaccess for bedrock on shared hosting
# @source http://www.mzoo.org/use-bedrock-on-shared-server/
#
# @usage Replace %host% with your domain.
# If your root is a subdirectory, append all instances of web/ with your subdirectory path.
# i.e. change /web/ to /path/to/dir/web/
<IfModule mod_rewrite.c>
Options -Indexes
# .htaccess primary domain to web redirect
# this file must be in the (public_html | web ) folder of your hosting account
@caasig
caasig / cakegittmpdirs
Last active August 29, 2015 14:25 — forked from tijmenb/cakegittmpdirs
Regenerate and commit CakePHP 2.x tmp dirs. To use this for 3.x just update the logs dir paths
#!/bin/bash
# Based on: http://stackoverflow.com/questions/2218075/using-git-with-your-cakephp-project
# MAKE SURE you commit any changes you want to keep before running this!
#
# Usage:
# 1. Drop this bash script into the same level as tmp/
# 2. cd path/to/this && ./cakegittmpdirs
# Procedure:
@caasig
caasig / .htaccess
Last active November 16, 2015 10:02
Root .htaccess for Thelia 2 on shared hosts
<IfModule mod_rewrite.c>
RewriteEngine On
# You need to reconfigure these System Variables in the back office to be a
# subdirectory under assets/
# 1) document_cache_dir_from_web_root
# 2) image_cache_dir_from_web_root
RewriteRule ^assets/(.*)$ web/assets/$1 [L]
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
@caasig
caasig / composer.json
Last active November 26, 2015 11:22
Starter composer.json for a Magento 1 project
{
"name": "vendor/your-project",
"description": "Your Awesome Project",
"require": {
"aydin-hassan/magento-core-composer-installer": "^1.3",
"magento/magento": "1.9.2.2",
"magento-hackathon/magento-composer-installer": "3.0.*"
},
"repositories": [
{
@caasig
caasig / demo.html
Created January 12, 2016 05:04 — forked from anonymous/demo.html
AngularJS: Mutually Exclusive Input Validation
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script>
var myApp = angular.module("myApp",[]) ;
myApp.controller('MyCtrl', ['$scope', function($scope) {
$scope.formModel = {};
}]);
myApp.directive('mutuallyExclusive', function() {
/* global module */
/**
* Based on https://github.com/substack/node-browserify/issues/1044#issuecomment-139384663
*/
(function (module) {
module.exports = bundleEntry;
var through2 = require('through2'),
browserify = require('browserify'),