-
resove the locale issue
locale-gen en_US en_US.UTF-8
andsudo locale-gen UTF-8
-
Permission denied while updating apt source with created user => use root user
ssh root@MYIP
and do it again and quit -
Need
sudo
to edit/etc/nginx/nginx.conf
-
Install Git
apt-get install git
-
Install dependencies
sudo apt-get install memcached mongodb redis-server imagemagick
This file contains hidden or 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
$tablet-width: 768px; | |
$desktop-width: 1024px; | |
@mixin tablet { | |
@media (max-width: #{$tablet-width - 1px}) { | |
@content; | |
} | |
} | |
@mixin desktop { |
This file contains hidden or 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
var btoa = require('btoa') | |
var fs = require('fs') | |
var pattern = fs.readFileSync('test.svg', { encoding: 'utf-8'}) | |
var b64 = btoa(pattern) | |
var b64 = "data:image/svg+xml;base64," + b64 | |
console.log(b64) |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am fraserxu on github. | |
* I am fraserxu (https://keybase.io/fraserxu) on keybase. | |
* I have a public key whose fingerprint is FAB4 7AE3 198F D595 1D44 D34C 311B 021F 9AFF 7F3F | |
To claim this, I am signing this object: |
This file contains hidden or 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
function dateAdd(date, interval, units) { | |
var ret = new Date(date); //don't change original date | |
switch(interval.toLowerCase()) { | |
case 'year' : ret.setFullYear(ret.getFullYear() + units); break; | |
case 'quarter': ret.setMonth(ret.getMonth() + 3*units); break; | |
case 'month' : ret.setMonth(ret.getMonth() + units); break; | |
case 'week' : ret.setDate(ret.getDate() + 7*units); break; | |
case 'day' : ret.setDate(ret.getDate() + units); break; | |
case 'hour' : ret.setTime(ret.getTime() + units*3600000); break; | |
case 'minute' : ret.setTime(ret.getTime() + units*60000); break; |
This file contains hidden or 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
var data = {"16":1,"17":5,"18":324,"19":396,"20":456,"21":441,"22":454,"23":525,"24":488,"25":499,"26":498,"27":551,"28":556,"29":556,"30":555,"31":558,"32":590,"33":543,"34":552,"35":621,"36":569,"37":593,"38":532,"39":565,"40":590,"41":625,"42":587,"43":624,"44":647,"45":718,"46":656,"47":724,"48":725,"49":690,"50":649,"51":650,"52":675,"53":666,"54":563,"55":663,"56":537,"57":619,"58":529,"59":535,"60":479,"61":484,"62":415,"63":457,"64":381,"65":332,"66":294,"67":333,"68":329,"69":262,"70":232,"71":245,"72":198,"73":198,"74":185,"75":193,"76":162,"77":221,"78":151,"79":155,"80":150,"81":122,"82":125,"83":99,"84":84,"85":115,"86":89,"87":105,"88":70,"89":65,"90":65,"91":59,"92":63,"93":55,"94":35,"95":38,"96":37,"97":27,"98":35,"99":30,"100":19,"101":19,"102":12,"103":12,"104":11,"105":8,"106":9,"107":5,"108":13,"109":5,"110":7,"111":2,"112":6,"113":3,"114":1}; | |
var ages = [], years = []; | |
var groupIndex = 1; | |
var maxGroupIndex = 16; | |
// make years | |
for (var i = 18; i < 98; i++ ) { | |
years.push(i) | |
} |
This file contains hidden or 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
// http://tex.stackexchange.com/questions/175598/how-to-compile-on-a-mac-after-upgrade-to-maverick-os-10-9-2 | |
It seems that the upgrade wiped the link from your Library (where MacTeX puts your actual TeX distribution) into your /usr/texbin. You can reinstate this link with the following: | |
ln -s /Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin \ | |
/usr/texbin | |
This will essentially create a shortcut at /usr/texbin that points to your texbin in MacTeX's internal directory. You still should make sure that /usr/texbin is in your PATH environment variable, though. | |
NB. If you use LateX -> PS -> PDF, you may also need to repair the link to ghostscript: | |
sudo ln -s /usr/local/bin/gs-noX11 gs |
This file contains hidden or 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
Running 'compile' for libxml2 2.9.2... ERROR, review '/Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ext/nokogiri/tmp/x86_64-apple-darwin14/ports/libxml2/2.9.2/compile.log' to see what happened. | |
*** extconf.rb failed *** | |
sudo gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 --use-system-libraries |
This file contains hidden or 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
var remote = require('remote') | |
var browserWindow = remote.require('browser-window') | |
var fs = remote.require('fs') | |
var path = remote.require('path') | |
var win = new browserWindow({ | |
width: 800, | |
height: 600, | |
show: false |
This file contains hidden or 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
# to get the internal ip | |
ifconfig | |
# to edit the config | |
sudo vim /etc/network/interfaces | |
auto lo | |
iface lo inet loopback | |
auto eth0 |