Skip to content

Instantly share code, notes, and snippets.

View rxaviers's full-sized avatar

Rafael Xavier de Souza rxaviers

View GitHub Profile
@rxaviers
rxaviers / gist:1825807
Created February 14, 2012 11:01
Custom Google Maps Autocomplete?
http://stackoverflow.com/questions/9276580/google-maps-api-v3-anyway-to-retrieve-autocomplete-results-instead-of-dropdown
@rxaviers
rxaviers / changes.diff
Created July 18, 2012 22:18
Changes needed for SpaNefertiti July/2012
diff --git a/SpaNefertiti.txt b/SpaNefertiti.txt
index ea763a4..a4f5c7a 100644
--- a/SpaNefertiti.txt
+++ b/SpaNefertiti.txt
@@ -8,40 +8,82 @@ O Spa Urbano Nefertiti é composto por uma equipe multiprofissional especializad
Dermatologia e Tricologia
Dermatologia
Dra Cinthia Trisóglio
[email protected]
Crm:138153
xavier@xavier ~/www/download.jqueryui.com $ sudo npm link
TypeError: path must be a string
at Object.fs.stat (fs.js:512:11)
at npm.commands (/usr/lib/nodejs/npm/lib/npm.js:44:17)
at /usr/lib/nodejs/npm/node_modules/mkdirp/index.js:37:53
at Object.oncomplete (fs.js:297:15)
npm ERR! TypeError: path must be a string
npm ERR! at Object.fs.stat (fs.js:512:11)
npm ERR! at npm.commands (/usr/lib/nodejs/npm/lib/npm.js:44:17)
npm ERR! at /usr/lib/nodejs/npm/node_modules/mkdirp/index.js:37:53

I have purposely forced an error building documentation by deleting the config file.

Running:

xavier@xavier ~/www/download.jqueryui.com/tmp/api.jqueryui.com $ grunt build-xml-entries

We get the full error:

>> TaskError: Unable to read "config.json" file (Error code: ENOENT).
>> No "build-xml-entries" targets found.
@rxaviers
rxaviers / gist:4038528
Created November 8, 2012 12:32
jQueryUI DB - Multiple release versions

Effort estimation plan (aka guess)

frontend

  • show multiple versions; 1h 👍
  • handle different components list per different jQueryUI version; 4h 👍

backend:

  • grunt prepate: 4h 👍
    • instead of getting user input, read config file and prepare all jQueryUI versions presented there;
# LANG=posix apt-get install -s xsltproc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libapr1 libaprutil1-ldap apache2-utils libaprutil1-dbd-sqlite3 apache2.2-bin
libaprutil1
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
xsltproc
diff --git a/app/resources/download.js b/app/resources/download.js
index 28f2dda..00bd3e6 100644
--- a/app/resources/download.js
+++ b/app/resources/download.js
@@ -24,6 +24,9 @@
downloadJqueryuiHost = downloadJqueryuiHost.replace( /(download\.)/, "stage.$1" );
}
+ /**
+ * Model
@rxaviers
rxaviers / gist:4207213
Created December 4, 2012 18:28
jQuery Coding Standard questions
  1. Nested functions with object parameter
// Coding standards says this is correct
foo( x, {
  a: "alpha",
  b: "beta"
});

// What about this?
server {
listen 80;
server_name dev.images.jqueryui.com;
access_log /var/log/nginx/image_jqueryui_access.log;
error_log /var/log/nginx/image_jqueryui_error.log;
root /tmp/image.jqueryui.com;
location / {
index index.php;
expires 30d; # Assume all files are cachable
<?
function ReduceColorDepth(&$gdimg, $colors=256, $dither=true) {
$colors = max(min($colors, 256), 2);
// ImageTrueColorToPalette usually makes ugly colors, the replacement is a bit better
//ImageTrueColorToPalette($gdimg, $dither, $colors);
phpthumb_filters::ImageTrueColorToPalette2($gdimg, $dither, $colors);
return true;
}
?>