Skip to content

Instantly share code, notes, and snippets.

@Fabryz
Fabryz / gist:3293643
Created August 8, 2012 09:06
How to install Node.js on Linux
$ sudo apt-get install git-core python libssl-dev build-essential
$ git clone git://github.com/joyent/node.git node && cd node
$ git checkout v0.8.6 (or check the latest stable version on https://github.com/joyent/node/tags)
$ ./configure
$ make (it will take some time)
$ sudo make install
Do a check with:
$ node -v
@Fabryz
Fabryz / gist:3157500
Created July 21, 2012 23:05
HTTP Headers
javascript:(function(){function read(url){var r=new XMLHttpRequest();r.open('HEAD',url,false);r.send(null);return r.getAllResponseHeaders();}alert(read(window.location))})();
@Fabryz
Fabryz / server.js
Created September 22, 2012 20:50
Phantomjs - render html files contained in dir to png
var page = require('webpage').create(), loadInProgress = false, fs = require('fs');
var htmlFiles = new Array();
console.log(fs.workingDirectory);
var curdir = fs.list(fs.workingDirectory);
// loop through files and folders
for(var i = 0; i< curdir.length; i++)
{
var fullpath = fs.workingDirectory + fs.separator + curdir[i];
// check if item is a file
@Fabryz
Fabryz / mysqldump-scp-mysql
Created June 30, 2016 09:31 — forked from magemonkey/mysqldump-scp-mysql
Copying a Magento Database from one server to another using mysqldump / scp / mysql
#1)
#SSH to the server you want to copy the database from
#[ssh template] - replace [IP] with actual server IP
ssh root@[IP]
#2)
#Find the database credentials from the database that you are copying in app/etc/local.xml
#[nano template]
nano [path to web root]/app/etc/local.xml
#In this file look for <connection> node and find the nodes <username> <password> <dbname>
@Fabryz
Fabryz / gist:8183654
Created December 30, 2013 15:47
1- Open %localappdata%/Overwolf/GameList.#######.xml" with a text editor 2- Paste the text at the end of the file, before the "</ArrayOfGameInfo>"
<GameInfo>
<ID>252490</ID>
<GameTitle>PlayRust</GameTitle>
<ProcessNames>
<string>rust.exe</string>
</ProcessNames>
<LuancherNames>
<string>Steam.exe</string>
</LuancherNames>
<GameRenderers>D3D9</GameRenderers>
var events = require('events');
module.exports = new events.EventEmitter();
@Fabryz
Fabryz / README.md
Created October 12, 2013 11:59 — forked from nikcub/README.md
@Fabryz
Fabryz / node-pilite.js
Last active December 20, 2015 20:18
Control the Pi Lite with Node.js $ npm install serialport $ node server.js
/*
* Description: Control the Pi Lite via Node.js
* Author: Fabrizio Codello (fabryz.com)
*
* TODO: Check if writing out of bounds
*/
var SerialPort = require("serialport").SerialPort;
// http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/280#Using the Pi-Lite pre-loaded software
var http = require('http');
var xmldoc = require('xmldoc');
var SerialPort = require("serialport").SerialPort;
function parseXML(data) {
var document = new xmldoc.XmlDocument(data);
var symbol = document.valueWithPath("Data.Symbol");
var price = document.valueWithPath("Data.LastPrice");
@Fabryz
Fabryz / gist:6186690
Created August 8, 2013 17:22
Simple Node.js script to write text on the Pi Lite
var SerialPort = require("serialport").SerialPort;
var serialPort = new SerialPort("/dev/ttyAMA0", {
baudrate: 9600
}, false);
serialPort.open(function () {
console.log('Connected to Pi Lite');
var text = "Hello World";