Skip to content

Instantly share code, notes, and snippets.

@mauriciopasquier
mauriciopasquier / gist:6ee8bcc5611c2b5d26e9395484e43a52
Created July 4, 2019 11:58 — forked from Manu343726/gist:ca0ceb224ea789415387
Running ARM docker image with QEMU on x86_64 Arch Linux host
# Install quemu, docker, etc
yaourt -S qemu qemu-user-static binfmt-support
# The quemu-user-static AUR package is outdated and broken. The .deb package they pull is no longer in the ubuntu repository.
# Edit the PKGBUILD and use qemu-user-static_2.4+dfsg-3_amd64.deb (With SHA1 sum "84d83a16c60c82b6c579f2f750b04a3ac26c249b")
# Enable ARM emulation
update-binfmts --enable qemu-arm
@mauriciopasquier
mauriciopasquier / geoserver
Last active February 20, 2018 12:18 — forked from dancingfrog/geoserver
Sample /etc/init.d script for running GeoServer as a service
#!/bin/sh
### BEGIN INIT INFO
# Provides: GeoServer
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Starts and stops the GeoServer, which should be located at /usr/share/geoserver
### END INIT INFO
@mauriciopasquier
mauriciopasquier / README.md
Created July 28, 2017 07:10 — forked from ynonp/README.md
react-rails and redux

react-rails and Redux

The main issue I found when integrating react-rails and flux/redux is managing application state. In redux I'd like to have a single application state serialized from the server and parsed in the client, and to use that state to initialize the main store. Something like:

initialState = JSON.parse(window.__APPSTATE__);

But that won't work since react-rails splits its work to 2 phases: it first reads all .js files in the renderer initialize phase and every call to the view helper only calls render.

Solution is described below by using a new renderer that:

FactoryGirl.define do
factory :photo do
image { Rack::Test::UploadedFile.new('spec/factories/test.png', 'image/png') }
description 'test description'
end
end

Turning Off Github Issues

My friend Michael Jackson turned off github issues on one of his smaller projects. It got me thinking...

Maintainers getting burned out is a problem. Not just for the users of a project but the mental health of the maintainer. It's a big deal for both parties. Consumers want great tools, maintainers want to create them, but maintainers don't want to be L1 tech support, that's why they

@mauriciopasquier
mauriciopasquier / deploy.rb
Created June 3, 2016 08:37 — forked from djo/deploy.rb
Rails, Nginx, XSendfile, and X-Accel-Mapping
# Symlink the shared protected folder
run "ln -nfs #{shared_path}/protected #{latest_release}/protected"
@mauriciopasquier
mauriciopasquier / gitprompt
Last active August 29, 2015 14:01
Agregalo a tu .bashrc
gris='\[\033[01;30m\]'
amarillo='\[\033[01;33m\]'
cls='\[\033[00m\]'
is_git() {
git rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/^/± /' -e 's/$/ /'
}
PS1="${amarillo}\$(is_git)${gris}\u@\h \W\$ ${cls}"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cartografía</title>
<script type="text/javascript" src="LibreVPN_files/d3.js"></script>
<script type="text/javascript" src="LibreVPN_files/index.js"></script>
<link type="text/css" rel="stylesheet" href="LibreVPN_files/force.css">
<link type="text/css" rel="stylesheet" href="LibreVPN_files/example-styles.css">
  • This creates a 560mb ramdisk. Adjust the size accordingly. I think the number at the end of the command is the number of disk blocks. They are 2kb in size for me.
  • Restarting postgres is not necessary; you can create the ramdisk and tablespace while postgres is running.
  • You will lose all data in the ramdisk tablespace when you shut your machine down

  $ diskutil erasevolume HFS+ "postgres_ramdisk" `hdiutil attach -nomount ram://1165430`
  Started erase on disk1
  Unmounting disk
  Erasing
 Initialized /dev/rdisk1 as a 569 MB HFS Plus volume