Skip to content

Instantly share code, notes, and snippets.

View BrongoObenge's full-sized avatar

Brink BrongoObenge

  • Netherlands
View GitHub Profile
@BrongoObenge
BrongoObenge / gist:44de680f237b69af7220
Last active August 29, 2015 14:07
Process specs crawler
`scrapy shell 'http://tweakers.net/pricewatch/416125/msi-geforce-gtx-970-gaming-4g/specificaties/' ``` #connects in shell with the source
`a = response.xpath('//table[@class="spec-detail"]/tr')` #creates variable a. var a is to get the table "spec-detail"
`b = a.xpath("//tr")` #makes var b, var is to get table row. Specify with [1-99]
`c = b[5].xpath("td[@class='spec-index-column']")` #gets the first table rows Option name (Category name)
`testa = b[5].xpath("td[@class='spec-column first']")`
`d = testa.xpath("span[@itemprop='mpn']")[0]` #gets the category answer
c gets the key
{
'rbs_wid_id': {
'MasterProgrammes-MasterProgrammes': '599',
'Studyabroad-Other': '607',
'Exchange-Other': '606',
'IBL-BachelorProgrammes-year4': '582',
'IBL-BachelorProgrammes-year1': '579',
'IBL-BachelorProgrammes-year3': '581',
'IBL-BachelorProgrammes-year2': '580',
'IBMSFastTrack-BachelorProgrammes-year1': '591',
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
@BrongoObenge
BrongoObenge / gist:878d02fd795627de57f2
Created May 20, 2015 11:56
Delete prune branches
`git checkout master && git branch -l | sed 's/* master//' > /tmp/gitlocal.txt && git branch -r | sed 's/origin\///' > /tmp/gitremote.txt && grep -Fxv -f /tmp/gitremote.txt /tmp/gitlocal.txt | xargs git branch -d`
Idee:
Loop de twee lists beide kanten op(Vergelijk x met y en y met x) en add the null values als een rating met de rating 0.
Code: https://spit.mixtape.moe/view/276dbc3e
Repo: https://bitbucket.org/Jiar/datasci1/src/03c55b390bd96f8511624b6d92ac68e381c64237/src/main/java/nl/hro/datasci/web/Controller.java?at=master&fileviewer=file-view-default#Controller.java-66:75
RESULT:
BEFORE:
#/bin/bash
printf "THIS IS FOR UBUNTU 14.04 ONLY!!\n\nHurry up and Control + X!"
sleep 3
if [ "$(id -u)" != "0" ]; then
printf "\nThis script must be run as root.. sowwy" 1>&2
exit 1
fi
apt-get update
/*
* Cloud Foundry 2012.02.03 Beta
* Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
*
* This product includes a number of subcomponents with
* separate copyright notices and license terms. Your use of these
* subcomponents is subject to the terms and conditions of the