Skip to content

Instantly share code, notes, and snippets.

HOST=http://radarr.local:7878
API_KEY= # Settings > General
ids=$(curl --silent $HOST/api/movie -X GET -H "X-Api-Key: $API_KEY" \
| jq '.[] | select(.monitored == false) | .id')
for id in $ids; do
echo "Deleting movie id $id"
curl --silent $HOST/api/movie/$id -X DELETE -H "X-Api-Key: $API_KEY"
done
@timelf123
timelf123 / mirror_remote_directory_to_local_directory
Created April 10, 2017 21:05 — forked from pixeline/mirror_remote_directory_to_local_directory
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY
@timelf123
timelf123 / guide.md
Created March 9, 2017 04:12 — forked from airtonix/guide.md
Guide: AdminToolkit for Arma3 ExileMod

Info

Server:

  • Boot2Docker Host:
    • Game Server: A Ubuntu 14.10 docker image based off houki/arma3
    • Database Server: official mariadb docker image

Client:

@timelf123
timelf123 / authInterceptor.js
Created February 23, 2017 21:02 — forked from bettysteger/authInterceptor.js
Set specific http headers on every http request from cookies (angular)
'use strict';
/**
* Authentication with token and email for every server request. (Sets HTTP headers)
*
* This interceptor shows the error from the server (i18n key).
* Also sets global error variable if the request fails and redirects the user to '/' when he is not authorized.
* @see http://engineering.talis.com/articles/client-side-error-logging/
*/
app.factory('authInterceptor', function ($rootScope, $q, $cookies, $location, $timeout) {
@timelf123
timelf123 / SimpleStore.js
Created February 20, 2017 20:21
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@timelf123
timelf123 / change_angular_scope.md
Last active February 6, 2017 16:35
Change Angular Scope via AB testing tool

How to Change the AngularJS Model from VWO

  • In VWO, set up a test
  • add js/css variation
<script>
// get Angular scope from a known DOM element
e = document.getElementById('someElement');
scope = angular.element(e).scope();
app.directive('faFastScroll', ['$parse', function ($parse) {
var Interval = function(min, max) {
this.min = min || 0;
this.max = max || 0;
};
Interval.prototype.clip = function(min, max) {
if(this.max <= min || this.min >= max) {
this.min = this.max = 0;
@timelf123
timelf123 / ngjson.js
Created January 27, 2017 23:08 — forked from tshaddix/ngjson.js
Very basic modification of Express JS res.json(). Adds the safety prefix for Angular JS to the body of all json responses. Extends the response object with one method: ngJSON. Simply require file somewhere in application (normally app.js) before executing ngJSON responses.
var http = require('http');
var NG_PREFIX = ")]}',\n";
http.ServerResponse.prototype.ngJSON = function(obj){
// allow status / body
if (2 == arguments.length) {
// res.json(body, status) backwards compat
if ('number' == typeof arguments[1]) {
this.statusCode = arguments[1];
@timelf123
timelf123 / shopify.md
Created November 8, 2016 20:50 — forked from lambtron/shopify.md
segment event tracking for shopify
title sidebar
Segment Event Tracking for Shopify
Shopify

Segment makes it simple for Shopify merchants to integrate analytics, email marketing, advertising and optimization tools. Rather than installing all your tools individually, you just install Segment once. We collect your data, translate it, and route it to any tool you want to use with the flick of a switch. Using Segment as the single platform to manage and install your third-party services will save you time and money.

The guide below explains how to install Segment in your Shopify store. All you need to get up and running is copy and paste a few snippets of code into your theme editor. (You don't have to edit the code or be versed in JavaScript.) The following guide will show you how, step by step.


@timelf123
timelf123 / app.js
Last active October 29, 2016 20:02 — forked from ezekielchentnik/app.js
import express from 'express';
const app = express();
if (IS_DEV) {
require('piping')(); // https://www.npmjs.com/package/piping -- live reload app - replaces nodemon
}
//express routes, etc.
export default app;