Skip to content

Instantly share code, notes, and snippets.

View penghou620's full-sized avatar

Peng Hou penghou620

  • LoadSmart Inc.
  • New York
View GitHub Profile
machine:
node:
version: 0.10.35
dependencies:
pre:
- sudo apt-get install -y libpoppler-glib-dev libpoppler-glib8 libcairo2-dev libcairo2
- sudo apt-get install -y libpq-dev
database:
override:
- psql -c 'create database test;' -U postgres
@penghou620
penghou620 / AWK Snippet
Created February 24, 2015 15:22
AWK Snippet
awk -F\t 'NR!=1 {printf "%s\t%s\t%s\t%s\n", $1,$2,$3,$16}' OFS="\t" 1.txt | node piping.js &> /tmp/r1.txt
@penghou620
penghou620 / ToDo
Last active August 29, 2015 14:15
ToDo
- [ ] Release
- [ ] driver email [#128](https://github.com/loadsmart/server/issues/218)
@penghou620
penghou620 / Procfile
Last active August 29, 2015 14:14 — forked from mojodna/Procfile
web: node app.js
worker: node consumer.js
@penghou620
penghou620 / nginx
Created September 29, 2014 20:39
This is nginx configuration file for WordPress and Node.js running parallel.
server {
listen 80;
root /var/www;
index index.php index.html index.htm;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
String[] myStringArray = new String[] { "Cool", "Very nice", "Hate it" };
ArrayAdapter adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, myStringArray);
ListView listView = (ListView) findViewById(R.id.listView1);
listView.setAdapter(adapter);
1 #!/bin/bash
2 ip=$(ifconfig eth0 | grep inet | awk '{print $2}' | cut -d':' -f2)
3 echo "To: dustsnow@126.com\nFrom: dustsnow@gmail.com\nSubject: IP Address\n" > msg.txt
4 echo ${ip} >> msg.txt
5
6 ssmtp dustsnow@126.com < msg.txt
@penghou620
penghou620 / theme_nice_menus
Last active December 22, 2015 13:49
Example code of using theme_nice_menus() function
$menu = theme('nice_menus',array(
'id'=>'main-menu',
'direction'=>'down',
'depth'=>-1,
'menu_name'=>'main-menu',
'menu'=>NULL,
));
print $menu['content'];
#!/bin/bash
ipaddr=$(ifconfig eth0 | grep 'inet addr:')
ROS_MASTER_URI=${ipaddr:20:12}
export ROS_MASTER_URI=$ROS_MASTER_URI
! 37 control_l
! 133 Super_L
! remove Lock = Caps_Lock
! remove Control = Control_L
! keysym Control_L = Caps_Lock
! keysym Caps_Lock = Control_L
! add Lock = Caps_Lock
! add Control = Control_L