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
private static bool FindInFile(string filename, string content) | |
{ | |
using (var reader = XmlReader.Create(filename)) | |
{ | |
var root = XDocument.Load(reader); | |
var nsmgr = new XmlNamespaceManager(reader.NameTable); | |
nsmgr.AddNamespace("ns", "http://www.portalfiscal.inf.br/nfe"); | |
return root.XPathSelectElement("//ns:infCpl", nsmgr).Value | |
.Split(new[] { "Ped_Num:" }, StringSplitOptions.None)[1] |
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
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" |
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
require 'uri' | |
require 'net/http' | |
source_url = "http://www.tripsay.com/api/json/tips/Paris,Ile-de-France,France?api_key=TEST&maxResults=5 " | |
url = URI.parse(source_url) | |
path=url.path | |
path=url.path+"?"+url.query | |
post = Net::HTTP::Get.new(path) |
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
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace Fibonacci | |
{ | |
[TestClass] | |
public class FibonacciTests | |
{ | |
[TestMethod] | |
public void TestReturn() | |
{ |
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
namespace ConsoleApplication1 | |
{ | |
using UrlExtensions; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var html = "http://www.google.com".Request(RequestOptions.KeepTrying); | |
Console.WriteLine(html); |
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
#!/usr/bin/env ruby | |
$LOAD_PATH << '.' | |
require 'rest_client' | |
require 'hpricot' | |
require 'config' | |
module ProcessLog |
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
sudo apt-get install g++ | |
sudo svn checkout http://v8.googlecode.com/svn/trunk/ /usr/local/v8 | |
cd /usr/local/v8 | |
make dependencies | |
make [arch] snapshot=on gdbjit=on liveobjectlist=on debuggersupport=on | |
sudo scons |
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
#configuring phantomJS | |
$ cd /usr/local | |
$ sudo git clone git://github.com/ariya/phantomjs.git && cd phantomjs | |
$ sudo ./build.sh | |
sudo ln -s /usr/local/phantomjs/bin/phantomjs /usr/local/bin/phantomjs | |
export PHANTOMJS_BIN=/usr/local/bin/phantomjs | |
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
#install heroku toolbelt | |
$ wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh | |
#login | |
$ heroku login | |
#upload your public key to heroku | |
$ ssh-keygen -t rsa -C "your_email@youremail.com" | |
$ heroku keys:add ~/.ssh/id_rsa.pub |
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
Had the same issue and found a workaround. This is how it occurred: | |
Had two VMs running, went home for the day | |
Windows updated and restarted during the night | |
Came to work, fired up cygwin and ran vagrant up dev. Saw that vagrant began creating a new box and cancelled. | |
Opened Virtualbox and saw that no VMs where listed. Found the path to "Default Machine Folder", opened it in Windows and saw that my previous VMs still existed on disk | |
Deleted the thrid VM on disk that was accidentally created with "vagrant up" | |
Readded the old VMs to Virtualbox by going to "Machine -> Add..." and adding the VMs from disk manually | |
Ran vagrant status | |
At this point the VMs where still listed as "(not created)". |
OlderNewer