Skip to content

Instantly share code, notes, and snippets.

## change 1
in special offer block
Change popup-info from svg into ¡ (unicode upside down !)
It is inside <script> tag
was:
const popupInfo = document.createElement('span')
popupInfo.classList.add('popup-info')
popupInfo.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z" fill="currentColor"></path></svg>`
<script>
(function () {
// return false if the query string does not contain a camp parameter
if (window.location.search.indexOf('camp=') === -1) return
// get the camp parameter value
let camp = window.location.search.split('camp=')[1].split('&')[0]
// get all links containing get.verisure
@icantrank
icantrank / Fibbonacier.js
Last active June 9, 2021 12:55
Fibbonacier.js - Someone showed me a bad example of array restructuring yesterday. i thought this was prettier.
let Fibbonacier = function() {
let cache = [1,1]
let step = () => {
let nums = [...cache]
let [a,b] = [nums.pop() || 1, nums.pop() || 1]
cache.push(a+b)
}
return {
step : step,
result: cache
@icantrank
icantrank / proxy.js
Created January 25, 2021 13:23
websocket proxy nodejs
// proxies requests to /folder to / on 8081
// proxies requests to /folder2 to /folder2/ on 8081
// all other requests sent to 8080
// listens on 80
var http = require('http');
//2 dependencies, install them
var proxyRules = require('http-proxy-rules')
var websocket = require('http-proxy');
@icantrank
icantrank / oodler.js
Last active June 9, 2021 12:56
oodler.js - node oodler and visit localhost in browser and lol
//node oodler and visit localhost in browser and lol
var http = require('http')
http.createServer( (req,res) => {
res.writeHead(200, {'contentType' : 'text/html'})
res.write(
`
<!DOCTYPE html>
<html lang="en">
<head>
@icantrank
icantrank / weather.js
Created September 18, 2017 20:41
Repeating OpenWeather API in node.js with database
let cron = require('node-schedule'), //npm install these or you're gna hae a bad time
loki = require('lokijs'), //loki is db with persistance coz saves json as a file
fetch = require('node-fetch') //browser fetch in node
let locations = ['London','Newcastle','Glasgow'] //or export an arr of locs in another file and require('./locations.js')
let openWeatherKey = '123456789abcdefghijk' //not a reel api key
let openWeatherUrl = (location) => {
return 'http://api.openweathermap.org/data/2.5/weather?q=' + location + ',uk&appid=' + openWeatherKey //change uk if you're grabbing data from elsewhere durr
@icantrank
icantrank / mailchimp-ajax.html
Last active September 18, 2017 20:21
Mailchimp subscription with ajax and jsonp (and publicly visible apikey but who gives af)
<!doctype html>
<!-- This works, but it's sketchy and leaves ur api key available for stealing -->
<!-- 17 revisions coz 8 tabs wtf github? -->
<head>
<title>Scetchy mailchimp form</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
</script>
</head>
<body>