Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Foxandxss's full-sized avatar

Jesús Rodríguez Foxandxss

View GitHub Profile
@Foxandxss
Foxandxss / default
Created September 15, 2012 12:11
Thin init.d script
RAILS_ENV=production
RAILS_ROOT=/srv/http/ruby/thin
CMD="/srv/http/.rvm/gems/ruby-1.9.3-p194/bin/thin start -C current/config/thin.yml"
serpIQ.factory('UserAccount', ['$resource', '$timeout', function($resource, $timeout) {
var userResource = $resource('/users/account', {}, {});
var accountInfo = {};
(function pollStatus() {
userResource.get({}, function(response){
accountInfo.foo = {
plan: response.plan,
@Foxandxss
Foxandxss / post-receive
Created January 26, 2014 12:30
My Lineman post-receive hook
#!/bin/sh
read oldrev newrev refname
LOGFILE=./post-receive.log
DEPLOYDIR=/var/www/lineman/project
echo -e "Received Push Request a $( date +%F )" >> $LOGFILE
echo " - Old SHA: $oldrev New SHA: $newrev Branch Name: $refname" >> $LOGFILE
[{"name":"User","color":"Red","position":{"x":100,"y":100},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"Name","type":"string","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0}],"relation":[{"extramethods":"","foreignkeys":"","name":"gadgets","relatedmodel":"Gadget","relationtype":"hasMany","usenamespace":""}],"seeding":[]},{"name":"Gadget","color":"Blue","position":{"x":872,"y":48},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"Name","type":"string","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c40","order":0}],"relation":[{"extramethods":"","foreignkeys":"","name":"owner","relatedmodel":"User","relationtype":"belongsTo","usenamespace":""}],"seeding":[]}]
@Foxandxss
Foxandxss / app.conf
Created October 29, 2014 21:55
nginx conf to serve php on /api
server {
server_name mroot.local;
root /var/www/laravel/mroot/client/tmp;
location / {
index index.html;
try_files $uri $uri/ /index.html =404;
}
location /api {
@Foxandxss
Foxandxss / backend.js
Last active February 1, 2016 14:02
A backend-less file for plunker
angular.module('plunker')
.config(function($provide) {
$provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);
})
.run(function($httpBackend) {
var things = [
{
id: 0,
title: 'Finish fake backend',
@Foxandxss
Foxandxss / modulepattern.md
Last active November 6, 2020 17:44
Module pattern Javascript (Español)

Scopes en Javascript:

Si haces algo en plan:

var a = 10;

function foo() {
  console.log(a);
}
@Foxandxss
Foxandxss / nginx-vhost
Last active June 12, 2020 07:12 — forked from bartvanremortele/nginx-vhost
Nginx vhost configuration for proxying requests to an API running on a different port. Easy to avoid CORS / JSONP
upstream api_node_js {
server 127.0.0.1:8080;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/my-kickass-domain/public_html;
index index.html index.htm;
@Foxandxss
Foxandxss / autolevel.md
Last active November 24, 2021 16:07
Tutorial de autolevel

Instalando el sensor

Lo primero será imprimir el soporte, y para ello en vez de usar el soporte ofrecido por skynet, vamos a usar uno alternativo de thingiverse.

Para sensores de 18mm (LJ18A3-8-Z/BX -- LJC18A3-H-Z/BY) necesitáis la pieza de 18mm que se instalará entre el ventilador y el disipador:

// FALTA FOTO, TENGO QUE INSTALAR EL SOPORTE NUEVO

También tendremos que conectarlo a la placa en lugar del final de carrera Z:

!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,u){for(var i,a,f,l=0,s=[];l<r.length;l++)t[a=r[l]]&&s.push(t[a][0]),t[a]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,u);s.length;)s.shift()();if(u)for(l=0;l<u.length;l++)f=o(o.s=u[l]);return f};var r={},t={3:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,o.nc&&u.setAttribute("nonce",o.nc),u.src=o.p+""+e+".chunk.js";var i=setTimeout(a,12e4);function a(){u.onerror=u.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return u.onerror=u.onload=a,c.appendChild(u),r},o.m=e