Skip to content

Instantly share code, notes, and snippets.

View renesansz's full-sized avatar
🎯
Focusing

Rene Padillo renesansz

🎯
Focusing
View GitHub Profile
@renesansz
renesansz / app.routes.js
Last active August 29, 2015 14:26
Sample Code
.state('app.search', {
cache: false,
url: 'search?postal_code',
views: {
navContent: {
templateUrl: NG_PATH.MODULES + 'search/view.html',
controller: 'SearchController as vm'
}
}
})
@renesansz
renesansz / config
Created July 30, 2015 03:58
Config file for Git. Sample config for using `git push all` to all remote
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = ssh://sls@slsapp.com:1234/bywave/hearing-australia-app.git
@renesansz
renesansz / scm.js
Last active August 29, 2015 14:25
Bonfire: Smallest Common Multiple
function gcd (a, b) {
// If num2 is 0 return num1
if ( ! b)
return a;
return gcd(b, a % b);
}
@renesansz
renesansz / DecimalToRoman.js
Created July 14, 2015 15:14
Decimal to Roman Numeral Converter
function DecimalToRoman(num) {
if (num <= 0 || num >= 4000) return num;
var roman = ["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"];
var decimal = [1000,900,500,400,100,90,50,40,10,9,5,4,1];
var romanStr = '';
for (var i = 0, limit = roman.length; i < limit; ++i) {
while (num >= decimal[i]) {
@renesansz
renesansz / SharedData.js
Last active October 26, 2015 20:14
Shared Data Service Provider
/**
* Angular App Factory: SharedData
*/
(function () {
'use strict';
angular.module('app.services')
.service('SharedData', SharedData);
@renesansz
renesansz / LocalStorage.js
Last active October 20, 2015 08:32
Local Storage Service Provider
/**
* Angular App Factory: LocalStorage
*/
(function() {
'use strict';
angular.module('app.factories')
.factory('LocalStorage', LocalStorage);
@renesansz
renesansz / append_digest.js
Created June 29, 2015 10:20
Append HTML string with ng-digest
$scope.link = function($elementRoot, element){
$elementRoot.append($compile(element)($scope));
$scope.$digest($elementRoot);
};
ListLessonsCtrl.link($scrollPane.find('.jspPane'),
'<div class="btn-lesson {{lesson.buttonColor}}" ng-repeat="lesson in lessons[\'' + day.id + '\'] track by $index|orderBy:lesson.created_at" ' +
'ng-init="lessonIdx = $index">' +
'<a class="btn btn-default" ng-click="showLessonSummary($index, \'' + day.id + '\')" onclick="preventExpand = true">' +
'{{lesson.name}} <div class="stud-ratio gone">| {{lesson.studTaken}} / {{lesson.studCount}}</div>' +
@renesansz
renesansz / mouse-wheel-listener.js
Created April 16, 2015 12:14
Mouse wheel listener for JavaScript.
'use strict';
(function(window) {
//
// Manipulate Mouse Wheel
// source: http://www.adomas.org/javascript-mouse-wheel/index.html
//
/**
* Function: MouseWheelEvent
@renesansz
renesansz / key-press-listener.js
Last active September 8, 2015 14:09
Key Press Listener for JavaScript
'use strict';
(function(window){
/**
* Function: Keydown
*
* Manipulate keypress actions.
*
* Parameters:
function doGet(request) {
var output = ContentService.createTextOutput();
var data = {};
var id = request.parameters.id;
var sheet = request.parameters.sheet;
var ss = SpreadsheetApp.openById(id);
if (sheet) {
data[sheet] = readData_(ss, sheet);
} else {
// Grab all sheets except those with a name