View gist:4dcbc39373709cbd56be0e22e138dbe7
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
import math | |
# from constraint import * | |
# | |
# problem = Problem() | |
# | |
# problem.addVariable("Q400 Eco", [80, 0, 0]) | |
# problem.addVariable("Q400 Aff", [0, 44, 0]) | |
# problem.addVariable("Q400 First", [0, 0, 19]) | |
# problem.addVariable("ORY", [368, 107, 19, 4.25]) |
View blogspot_to_jekyll.rb
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 | |
# | |
# Convert blogger (blogspot) posts to jekyll posts | |
# | |
# Basic Usage | |
# ----------- | |
# | |
# ./blogger_to_jekyll.rb feed_url | |
# | |
# where `feed_url` can have the following format: |
View new_query.sql
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
SELECT data.id | |
FROM (select j1.id as id, | |
j1.title, | |
case | |
when active_job.location isnull | |
then :radius | |
when j1.location isnull | |
then :radius | |
else st_distance(j1.location, active_job.location) end as dist, | |
similarity(j1.title, active_job.title) as close, |
View material_view.sql
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
create materialized view similar_mv as (select j.id, | |
j.title, | |
j.source, | |
j.created_at, | |
j.updated_at, | |
j.category_id, | |
b2bt.company, | |
lt.location | |
from job_tb j | |
join b2b_tb b2bt on j.b2b_id = b2bt.id |
View legacy.sql
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
SELECT data.id | |
FROM (select j1.id as id, | |
j1.title, | |
b1.company, | |
case | |
when active_job.location isnull | |
then :radius | |
when l1.location isnull | |
then :radius | |
else st_distance(l1.location, active_job.location) end as dist, |
View pdf.js
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
Number.prototype.pad = function (size) { | |
var s = String(this); | |
while (s.length < (size || 2)) { | |
s = "0" + s; | |
} | |
return s; | |
} | |
function run() { | |
chrome.storage.sync.get(['name', 'address1', 'address2', 'zip', 'city', 'country', 'articles', 'buyDateString', 'payDateString', 'rnr', 'shipping', 'invoiceFileDate'], (result) => { |
View popup.js
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
// var app = chrome.runtime.getBackgroundPage(); | |
document.addEventListener('DOMContentLoaded', function () { | |
debugger; | |
console.log("the doc loaded") | |
var form = document.getElementById("form") | |
console.log(form) | |
form.addEventListener('submit', function (e) { | |
e.preventDefault() | |
console.log("added to the form") |
View popup.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
<html> | |
<body> | |
<form id="form"> | |
<input type="number" id="rnr" placeholder="Rechnungsnummer" style="margin-bottom: 10px"> | |
<input type="submit" value="Rechnung Erstellen"> | |
</form> | |
<script type="text/javascript" src="popup.js"></script> | |
</body> | |
</html> |
View content.js
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
const name = $("#buyercontactname").val(); | |
const address1 = $('#buyeraddress1').val(); | |
const address2 = $('#buyeraddress2').val(); | |
const zip = $('#buyerzip').val(); | |
const city = $('#buyercity').val(); | |
const country = $('#buyercountry').children("option:selected").attr('id'); | |
let big_table = $('#ERSShipnHand').find("table"); | |
let all_articles = [] |
View ebay-impressions.js
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
// Paste that in Google console | |
$$('#meb-items-cnt > section.active-page__list > div > div > div > div > div.col-3 > div.me-item-activity > div:nth-child(1) > span.me-item-activity__column-count').reduce((a, c)=>a+parseInt(c.innerHTML), 0) |
NewerOlder