Skip to content

Instantly share code, notes, and snippets.

@radmen
radmen / user.js
Last active August 21, 2023 07:59
Asana - Copy Unique Task URL
// ==UserScript==
// @name Asana - Copy Unique URL
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Shows the truly unique URL of the Asana task
// @author Radoslaw Mejer <radmen [at] radmen.info>
// @match https://app.asana.com/0/*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @run-at document-idle
@radmen
radmen / README.md
Last active July 24, 2023 11:41
Seafile alias for NuShell

This is an alias (with typings) of Laravel Sail for NuShell.

Installation

  • place the file in a config directory of choice (i.e., ~/.config/nushell)
  • source the file in config.nu:
    source ~/.config/nushell/sail.nu
    
@radmen
radmen / README.md
Last active April 12, 2023 10:21
Generate Cloudflare config tunnel and run it

This is a simple script that will generate a config for cloudflared (with the spec you provide) and run it.

Usage

Generate a single tunnel that redirects mydomain.work to localhost:8080:

cftunnel :8080
@radmen
radmen / README.md
Created September 10, 2012 08:15
Apache vhost config for gitlab

unicorn config file

Edit file /home/gitlab/gitlab/config/unicorn.rb

Find line listen "#{app_dir}/tmp/sockets/gitlab.socket" and comment it. Uncomment line listen "127.0.0.1:8080"

required modules for apache

  • sudo a2enmod proxy
  • sudo a2enmod proxy_balancer
@radmen
radmen / README.md
Last active December 11, 2020 12:54
Eloquent search scope

Little code snippet inspired by Freek and others. Most likely, almost a copy of their implementation. I'm using this a lot in recent projects, so I'd like to keep it easily accessible.

Scope supports:

  • searching using relations
  • (optional) breaking the word by space and matching to all parts

How it works

@radmen
radmen / README.md
Last active December 23, 2019 09:48
Injected package in yarn.lock

This is a simple example of injecting a different package using the lock file.

yarn command will install boolean in place of ms.

@radmen
radmen / 10-nordvpn.sh
Created April 30, 2019 10:50
NordVPN + Docker
#!/usr/bin/env bash
INTERFACE=$1
STATUS=$2
# Make sure we're always getting the standard response strings
LANG='C'
case "${INTERFACE}-${STATUS}" in
tun0-up)
const deepEql = require('deep-eql')
const input = require('./input.json')
const output = require('./output.json')
const groupByDate = (messages) => messages.reduce(
(carry, message) => {
const copy = Array.from(carry)
const tail = copy.pop();
const groupDate = new Date(message.created_at).getDate();
@radmen
radmen / README.md
Last active July 18, 2018 11:10
Simple AFK script

This simple Bash function will post a short message to #afk Slack channel.

After posting the message it will wait for user interaction on which it will post a message that the user returned.

To run it:

  1. generate legacy token for selected workspace
  2. add it to declaration of TOKEN variable
  3. import somewhere (eg .bash_aliases) function from afk.sh file
@radmen
radmen / env.py
Last active June 27, 2018 13:34
Python: export selected env variables
#!/usr/bin/env python
import argparse
import os
parser = argparse.ArgumentParser(description='Export selected env variables.')
parser.add_argument('name', nargs='+',
help='name of env variable')