This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
complete drawing | |
https://github.com/tomchentw/react-google-maps/issues/796 | |
click-me popup | |
http://google-map-react.github.io/google-map-react/map/events | |
react leaflet | |
https://react-leaflet.js.org/en/ | |
adding marker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const save = () => { | |
return new Promise((resolve, reject) => { | |
// access the db | |
// save the file | |
// when the file is saved successfully | |
// resolve with the saved document | |
resolve(doc) | |
// if there was an error | |
reject(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Router, Route, Link, Redirect } from 'react-router-dom'; | |
import { getCurrentUser } from './helpers'; | |
class Home extends Component { | |
constructor(props) { | |
super(props); | |
this.state = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install postgres | |
initdb /usr/local/var/postgres | |
psql postgres -c "create role postgres with login superuser" | |
psql postgres -c "alter user postgres with password 'password'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
mkdir modules apc | |
cd apc | |
wget http://pecl.php.net/get/APC-3.1.9.tgz | |
tar -xzvf APC-3.1.9.tgz | |
cd APC-3.1.9 | |
phpize | |
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config | |
make | |
cd modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unicorn.rb | |
----------------------------------- | |
application = "jarvis" | |
remote_user = "vagrant" | |
env = ENV["RAILS_ENV"] || "development" | |
RAILS_ROOT = File.join("/home", remote_user, application) | |
worker_processes 8 | |
timeout 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh root@nas.mybox.com | |
vi /etc/ssh/sshd_config | |
# override default of no subsystems | |
#Subsystem sftp /usr/libexec/sftp-server | |
Subsystem sftp internal-sftp | |
# restart ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
// usage: $(‘div.unevenheights’).setAllToMaxHeight() | |
// http://www.broken-links.com/2009/01/20/very-quick-equal-height-columns-in-jquery/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.docker.boot2docker</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/boot2docker</string> | |
<string>up</string> |