Skip to content

Instantly share code, notes, and snippets.

View porkopek's full-sized avatar
📈
Working from home

Porkopek porkopek

📈
Working from home
View GitHub Profile
@flaub
flaub / SqliteContext.cs
Created March 16, 2015 08:21
SQLite EF 6 Database Initializer
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.SQLite;
using System.Linq;
namespace SQliteEF6
{
class SqliteContext : DbContext
@DotNetNerd
DotNetNerd / PhantomRunner.cs
Created May 23, 2013 11:20
Grabbing a site in C# using phantomJS
class Program
{
static void Main(string[] args)
{
var grabby = new Grabby();
string output = grabby.Grab("http://www.dotnetnerd.dk/cv");
Console.WriteLine(output);
File.WriteAllText("c:\\test.html", output);
}
@jkeck
jkeck / gist:3515705
Created August 29, 2012 17:07 — forked from MrDys/gist:3512455
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id and is classed with modal and permalink:
<div class="modal permalink" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@crazy4groovy
crazy4groovy / jQueryPhantomScrape
Created June 18, 2012 15:47
Scrape the web using PhantomJS and jQuery
//This is an example of how to scrape the web using PhantomJS and jQuery:
//source: http://snippets.aktagon.com/snippets/534-How-to-scrape-web-pages-with-PhantomJS-and-jQuery
//http://phantomjs.org/
var page = new WebPage(),
url = 'http://localhost/a-search-form',
stepIndex = 0;
/**
* From PhantomJS documentation: