Skip to content

Instantly share code, notes, and snippets.

View felquis's full-sized avatar
🔎
aligning divs with style

Felquis G felquis

🔎
aligning divs with style
View GitHub Profile
$scope.loadingNewPhoto = false;
$cordovaCamera.getPicture({
sourceType: (index == 1) ? Camera.PictureSourceType.PHOTOLIBRARY : Camera.PictureSourceType.CAMERA,
destinationType: (typeof Camera !== "undefined") ? Camera.DestinationType.FILE_URI : false,
targetWidth: 512,
targetHeight: 512
}).then(function(imageData) {
var ft = new FileTransfer();
@felquis
felquis / Ionic-report:-problem-with-view-events.markdown
Created December 16, 2014 22:23
Ionic report: problem with view events
@felquis
felquis / data.js
Last active August 29, 2015 14:12
var item = {
'property-one':[
{name: 'string', id: 1, total: 1},
{name: 'string', id: 2, total: 1},
{name: 'string', id: 3, total: 1},
{name: 'string', id: 4, total: 1},
{name: 'string', id: 5, total: 1}
],
'property-two': [
{name: 'string', id: 6, total: 1},
@felquis
felquis / Gruntfile.js
Last active August 29, 2015 14:16
Facebook Plugin configuration
// `grunt-shell` config:
shell: {
facebookDownload: {
command: [
'echo "## Downloading Facebook Plugin"',
'git clone git@github.com:Wizcorp/phonegap-facebook-plugin.git .tmp-plugin/phonegap-facebook-plugin/',
'cd .tmp-plugin/phonegap-facebook-plugin/',
'echo "## Checkout tag 0.10.1"',
'git checkout 0.10.1 -q',
var accordion = (function ($) {
'use strict'
var accordionMethods = {},
tabsList,
tabWrapper,
tabSelector,
tabWrapper,
shell: {
facebookDownload: {
command: [
'echo "## Downloading Facebook Plugin"',
'git clone git@github.com:Wizcorp/phonegap-facebook-plugin.git .tmp-plugin/phonegap-facebook-plugin/',
'cd .tmp-plugin/phonegap-facebook-plugin/',
'echo "## Checkout tag v0.11.0"',
'git checkout v0.11.0 -q',
'cd ./../../'
@felquis
felquis / file.js
Created September 2, 2015 16:38
I found a minified JavaScript file on the internet and I decided to re-format the whole code to a human-like code, but I got into the following doubt
// I figured out this function looks like RequireJS's `define` function
// but I couldn't find a source or resource to help me understand this code
// I'll appreciate some help, links to clearly docs
// NOTE: I'm not interested in how RequireJS works, cause it's source code is huge,
// I just want to understand how the code bellow works. Maybe the source above documented
//
//
// I think it's a output file from browserify or some tool like that
function define(modules, n, r) {
@felquis
felquis / removeAllStyles.js
Created September 7, 2015 03:30
pt-BR: Remove todos os estilos de uma página
var styles = document.querySelectorAll('link[href$=".css"]')
styles = nodeListToArray(styles)
function nodeListToArray(nodeList) {
return Array.prototype.slice.call(nodeList)
}
function removeNode(node) {
node.parentElement.removeChild(node)
}
@felquis
felquis / removeAllStyles.js
Last active September 7, 2015 03:38
Remove todos os estilos de uma página
var styles = document.querySelectorAll('link[rel="stylesheet"], style')
styles = nodeListToArray(styles)
function nodeListToArray(nodeList) {
return Array.prototype.slice.call(nodeList)
}
function removeNode(node) {
node.parentElement.removeChild(node)
}
@felquis
felquis / something.js
Last active September 7, 2015 04:10
The `undefined` kind of issue
/*
Return the same of `.get(index)` method,
but if the return of `.get` is undefined
this method will return an empty array `[]`
and NOT an `undefined`
Useful to make sure things wont break if
an element isn't in the DOM
*/
var getThat = function (index) {