Skip to content

Instantly share code, notes, and snippets.

@adnanmc
adnanmc / scrap.rb
Last active May 9, 2016 02:35
web scraping with mechanize gem
require 'nokogiri'
require 'mechanize'
agent = Mechanize.new
# page = agent.get('http://www.meetup.com/hackerhours/members')
# name = page.search('.memName')[0].text
#puts name[0]
import { Injectable } from '@angular/core';
import { AngularFire, FirebaseListObservable } from 'angularfire2';
import 'rxjs/add/operator/map';
import { Business } from '../Business';
import { Category } from '../Category';
@Injectable()
export class FirebaseService {
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AngularFireModule } from 'angularfire2';
import { AppComponent } from './app.component';
// Must export the config
import { Component, OnInit } from '@angular/core';
import { FirebaseService } from './services/firebase.service';
import 'rxjs/add/operator/filter';
import { Business } from './Business';
import { Category } from './Category';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
const express = require('express');
const bodyParser = require('body-parser');
process.env.dataFeed = 'off';
process.env.intervalObject = null;
var app = express();
const port = 3000;
app.use(bodyParser.json());
app.get('/on', (req, res) => {
let dataFeedStatus = process.env.dataFeed;
if (dataFeedStatus === 'off') {
var _ = require('lodash');
const data = [
{
MediaAssetId: 0,
Exposure: null,
QtyImps: null,
QV: null,
AvgAttendance: null,
Games: null,
SportId: 0,
@adnanmc
adnanmc / import_csv_to_mongo
Last active August 3, 2018 14:46 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)

Mounting VirtualBox shared folders on Ubuntu Server 18.04 LTS (Bionic Beaver)

This guide will walk you through the steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

You could still make this guide work with other setups (possibly with some modifications to the commands and whatnot).