Skip to content

Instantly share code, notes, and snippets.

@SippieCup
SippieCup / showbest.js
Created July 8, 2017 13:51 — forked from scott-maddox/showbest.js
For use with spaceplan
// Paste in console
var getThings = function(){
var divs = [...document.querySelectorAll("#manufacture__container > div")]
var things = divs.map(function(e){
var result = {e};
var spans = [...e.getElementsByTagName("span")]
spans.map(function(s){
var str = s.innerText.replace(/[^/.0-9]/g, '');
var a = str.split("/");
var num = +a[0];
@SippieCup
SippieCup / ExtendedUserModel.js
Created July 25, 2017 11:30
Loopback MultiUser Example
module.exports = function (ExtendedUserModel) {
ExtendedUserModel.afterRemote('create', function(context, user, next) {
createDriver(user)
.then(createCustomer(user)
.then(sendVerificationEmail(user)
.then( () => next())));
function createDriver(user) {
if (user.realm==="driver") {
return user.driver.create({Licensed: true});
@SippieCup
SippieCup / ExtendedUserModel.js
Last active July 25, 2017 12:06
MailGun Verification
module.exports = function (ExtendedUserModel) {
ExtendedUserModel.afterRemote('create', function(context, user, next) {
sendVerificationEmail(user).then( () => next());
function sendVerificationEmail(user) {
var options = {
type: 'mailgunEmail',
to: user.email,
from: 'noreply@mailGun.com',
subject: 'Thanks for registering.',
@SippieCup
SippieCup / eltool.sh
Last active October 11, 2017 17:24 — forked from dimkir/eltool.sh
Tool for building dependencies for electron on Amazon Linux (and maybe on CentOS / RHEL)
#!/bin/bash
DIST_DEPS=0
CENTOS_DEPS=0
GCONF_COMPILE=0
GCONF_INSTALL=0
PIXBUF_INSTALL=0
PIXBUF_COMPILE=0
@SippieCup
SippieCup / ombi.sh
Last active December 18, 2017 16:26
Automated Migration to Ombi 3 in OpenFLIXR.
#!/bin/bash
echo 'Starting automated Ombi Migration'
echo 'Downloading...',
cd /tmp/
apt-get -y install libunwind8
mkdir /opt/ombi
wget https://ci.appveyor.com/api/buildjobs/e9gylkx5j5ty8jty/artifacts/linux.tar.gz
echo '\t [Done]'
echo 'Extracting...',
tar xvzf linux.tar.gz -C /opt/ombi
<?php
/**
* PHP IMDb.com Grabber
*
* This PHP library enables you to scrap data from IMDB.com.
*
*
* If you want to thank me for this library, please buy me something at Amazon:
* https://www.amazon.de/gp/registry/wishlist/8840JITISN9L/ - thank you in
@SippieCup
SippieCup / spark.sh
Last active December 28, 2017 16:47
spark.sh
#!/bin/bash
apt-get update -y
apt-get install default-jdk -y
apt-get install git -y
wget http://mirror.cc.columbia.edu/pub/software/apache/spark/spark-2.2.1/spark-2.2.1-bin-hadoop2.7.tgz
mkdir /usr/local/share/spark
tar xvfz spark-2.2.1-bin-hadoop2.7.tgz -C /usr/local/share/spark
cd /usr/local/share/spark
@SippieCup
SippieCup / ombi_autoinstall.sh
Last active January 9, 2018 13:32
ombi autoinstaller
#!/bin/bash
echo 'Starting automated Ombi Migration'
echo 'Downloading...',
cd /tmp/
apt-get -y install libunwind8
mkdir /opt/ombi
wget https://ci.appveyor.com/api/buildjobs/ucvh6jksnjkgs54h/artifacts/linux.tar.gz
echo '\t [Done]'
echo 'Extracting...',
@SippieCup
SippieCup / .gitlab-ci.yml
Created March 26, 2018 20:34
Gitlab deploy to ionic cloud
deploy-app:
type: deploy
environment: ionic-deployment
only:
- development
- master
- production
when: manual
script:
##
#!/bin/sh
while [[ $count -ne 0 ]] ; do
ping -c 1 8.8.8.8
rc=$?
if [[ $rc -eq 0 ]] ; then
connection = 'true'
((count = 1))
fi
((count = count - 1))
done