Skip to content

Instantly share code, notes, and snippets.

Joseph Finlayson josephfinlayson

Block or report user

Report or block josephfinlayson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View proxy.pac
function FindProxyForURL(url, host) {
if (shExpMatch(host,"*.gpsrv.com")) {
return "SOCKS5 127.0.0.1:5000; SOCKS 127.0.0.1:5000"
}
return "DIRECT"
}
@josephfinlayson
josephfinlayson / gist:4e9325465ccabf654ad7
Last active Sep 1, 2019
python script to access tesco API
View gist:4e9325465ccabf654ad7
import urllib
import json
import datetime
now = datetime.datetime.now()
outputFilename = 'tescoproduct_' + now.strftime("%Y%m%d") + '.csv'
def LoginAndGetSessionKey():
@josephfinlayson
josephfinlayson / read-access.sql
Created Aug 1, 2019 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
View read-access.sql
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
View ofxconverter.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View paypal.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josephfinlayson
josephfinlayson / diffObjs.js
Created Feb 10, 2017
Difference between objects
View diffObjs.js
import R from 'ramda'
const groupObjBy = R.curry(R.pipe(
// Call groupBy with the object as pairs, passing only the value to the key function
R.useWith(R.groupBy, [R.useWith(R.__, [R.last]), R.toPairs]),
R.map(R.fromPairs)
))
const diffObjs = R.pipe(
R.useWith(R.mergeWith(R.merge), [R.map(R.objOf("leftValue")), R.map(R.objOf("rightValue"))]),
View gist:d9c79a73cecf4f24bf91167a1cfe43e8
package com.tutorialspoint;
import org.springframework.context.annotation.*;
@Configuration
public class HelloWorldConfig {
@Bean
public HelloWorld helloWorld(){
return new HelloWorld();
}
View decorators.js
/**
* This function is used to push client side events to redshift. It should only be used for client side only events,
* any event that involves a request to the backend, will create similar events there
*
* ::USAGE::
* ========
*
* analyticsDecorator({
* constant: 'CONSTANT', mapping(arg1, arg2) {
* return {
View gist:7309474
curl https://raw.github.com/adimania/arch-desktop-environments/master/XFCE-Arch-RPi.sh | bash
@josephfinlayson
josephfinlayson / gist:7283759
Last active Dec 27, 2015
backup SD card image of pi
View gist:7283759
sudo fdisk -l
//find active sd card
// copy image over
ssh pi@raspberry sudo dd if=/dev/mmcblk0 | gzip -c > raspberry.img.gz
You can’t perform that action at this time.