Skip to content

Instantly share code, notes, and snippets.

@clouddueling
clouddueling / contactSystems.js
Created August 17, 2013 18:21
Highcharts json for angular js
$scope.main.graphs = {
totalSystemsCompleted: {
title: {
text: 'Total Completed Systems By User'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.y:,.0f}</b>'
},
yAxis: {
min: 0,
@clouddueling
clouddueling / progressChart.js
Last active December 21, 2015 05:38
Google Charts json for angularjs
$scope.progressChart = {
type: "PieChart",
displayed: false,
cssStyle: "height:200px; width:100%;",
data: {
"cols": [
{id: "month", label: "Today's Progress", type: "string"},
{id: "completed-id", label: "Completed Today", type: "number"},
{id: "due-id", label: "Due Today", type: "number"},
{id: "overdue-id", label: "Overdue", type: "number"}
@clouddueling
clouddueling / confirm.js
Created August 14, 2013 16:57
confirm directive angularjs
directives.directive('confirmButton', function($document) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var buttonId, html, message, nope, title, yep;
buttonId = Math.floor(Math.random() * 10000000000);
attrs.buttonId = buttonId;
@clouddueling
clouddueling / confirmButton.js
Last active December 21, 2015 02:09
Confirm button javascript
function loadPopoverConfirm() {
$('[data-popover-confirm]').popover({
html: true,
placement: 'left',
trigger: 'manual',
content: "<span data-popover-confirm-container> \
<span class='btn btn-primary popover-confirm-btn'> \
Confirm \
</span> \
<span class='btn popover-cancel-btn'> \
<pre>
<?php
// ---------------------- CONFIG DETAILS ----------------------
//branch in git
$BRANCH = 'master';
// --------- You should not need to edit below here ------------
$current_sha1 = `git rev-parse $BRANCH`;
$status_of_branch = `git ls-remote origin -h refs/heads/$BRANCH`;
@clouddueling
clouddueling / httpd.conf
Created August 13, 2013 20:39
httpd.conf for laravel development
NameVirtualHost *
SetEnv LARAVEL_ENV development
<VirtualHost *>
DocumentRoot "/Users/tszemkus/Dropbox/webserver"
ServerName localhost
</VirtualHost>
<VirtualHost *>
@clouddueling
clouddueling / MainCtrl.js
Last active November 3, 2022 13:26
How to authenticate using AngularJS
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
@clouddueling
clouddueling / MainCtrl.js
Created August 9, 2013 04:18
Using facebook with AngularJS
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.main = {
facebookAppId: '',
user: {},
serie: {},
cloudUrl: $('[data-cloud-url]').data('cloud-url'),
serieId: $('[data-serie-id]').data('serie-id'),
active: {
categoryId: 0,
category: {},
@clouddueling
clouddueling / .htaccess
Last active December 18, 2015 21:09
Force https on elastic beanstalk
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_HOST} =clouddueling.com [OR]
RewriteCond %{HTTP_HOST} =www.clouddueling.com
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI}%{QUERY_STRING} [L,R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
@clouddueling
clouddueling / modular.js
Created June 6, 2013 06:41
Javscript modular pattern
var NewsWidget = (function(window, document, undefined){
// private
var name = ‘Chris’;
function createMember() {
}
// public
return {