Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

ayrton 0xae

🏠
Working from home
Block or report user

Report or block 0xae

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View nginx-reverse-proxy.conf
server {
server_name my.api.com ;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
View website.com
# Default server configuration
server {
root /var/www/99app.xbtfinex.com/;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name 99app.xbtfinex.com;
location / {
View json_q3.js
{"groups":{"Q3":[{"Q301_ID_01":"8","Q301_ID_02":"82","Q301_ID_03":"821","Q301_ID_04":"821004","Q301_ID_05":"8210041","Q301_ID_06":"8210040011","Q301_ID_07":"14.964651","Q301_ID_08":"-24.47398","Q301_ID_RAIO_ACAO":"","Q301_ID_09":"8210040011001","Q301_ID_10":1,"Q301_ID_11":7,"Q301_ID_12":"16-04-2015","Q301_ID_13":"29-04-2015","Q301_ID_14":"20-04-2015","Q302_IN_01":"1","Q302_IN_02":4,"Q302_IN_03":"1","Q302_IN_04":"","Q302_IN_05":2,"Q302_IN_06":"1","Q302_IN_07":"1","Q302_IN_08":"","Q303_IN_09":"1","Q302_IN_10":"1","Q302_IN_11":"2","Q302_IN_12":"1","Q302_IN_13":"","Q302_IN_14":"1","Q302_IN_15":"","Q302_IN_16":"3","Q302_IN_18":"2","Q302_IN_19":"2","Q302_IN_20":"2","Q302_IN_21":"1","Q302_IN_22":"3","Q302_IN_23":"3","Q302_IN_24":"1","Q302_IN_25":"","Q302_IN_26":"","Q302_IN_27":"","Q302_IN_28":"","Q302_IN_29":"2","Q302_IN_30":"","Q302_IN_31":"","Q302_IN_32":12000,"Q302_IN_33":"2","Q302_IN_34":"","Q303_AT_01":"1","Q303_AT_02":"1","Q303_AT_03":1,"Q303_AT_04":"2","Q303_AT_05":"2","Q303_AT_06":"2","Q303_AT_07":"1","Q303_
View request1.js
POST http://inqueritos.ine.cv/survey/object/Q4
{
"errorType":"error",
"errors":[
"Data é invalida 16/12/14 para o campo Data Inicio Ciclo.",
"Data é invalida 29/12/14 para o campo Data Fim Ciclo."
],
"id":0
}
View save_beginning.js
var edificio = $stateParams.idEdificio;
var alojamento = $stateParams.idAlojamento;
var agregado = $stateParams.idAgregado;
var chave = "RGA::agregado::" + edificio + "." + alojamento + "." + agregado;
$localForage.getItem(chave).then(
function (data){
$scope.data = data;
}
);
View prepare_section.js
MapAttrsToGroups : function (section) {
var defer = $q.defer();
var merged = [];
var cache_groups = {};
var elements = section.attr.elements;
for (var i = 0; i < elements.length; i++) {
var field = elements[i];
if (!field.attr.group.id) {
merged.push(field);
View save_alojamento.js
$scope.save = function (data){
_prepareSectionToSave(data);
var i = data.attr.agregados || 0;
var agregados = parseInt(data.attr.elements[6].attr.value);
$localForage.getItem("51::fields").then(
function (agregadoQuest){
var conf = agregadoQuest[0];
for(; i<agregados; i++){
var agregadoQuestChave = "RGA::agregado::" + edificio + "." + alojamento + "." + (i+1);
View sync_button.html
<span class="item-note">
<!-- {{sample.values[5]}} -->
<button class="button button-clear" ng-class="sample.sync ? 'button-balanced' : 'button-assertive'" style="min-height:21px;" ng-click="syncData(e);">
<i class="icon ion-paper-airplane"></i>
</button>
</span>
View clean_alojamentos.js
// Reset Alojamentos
$localForage.keys().then(function(keys){
keys.forEach(function(k){
if (k.indexOf("RGA::agregado::") != -1 || k.indexOf("RGA::alojamento::") != -1)
$localForage.removeItem(k)
})
})
// Reset Samples
View alojamentoCtrl.js
app.controller("AlojamentoCtrl", function ($q, $scope, $localForage, $stateParams){
$scope.alojamentos = [];
var id = $stateParams.idEdificio;
$scope.edificio = id;
$localForage.keys().then(
function (chaves){
var prefixo = "RGA::alojamento::" + id + ".";
var ary = [];
for (var i = 0; i < chaves.length; i++) {
You can’t perform that action at this time.