Skip to content

Instantly share code, notes, and snippets.

View terry90's full-sized avatar
🏠
Working from home

Terry Raimondo terry90

🏠
Working from home
  • GetPro
  • 07:19 (UTC +01:00)
View GitHub Profile
@terry90
terry90 / application.rb
Last active April 25, 2016 12:17
Notification system (with mailer) for Rails 4
# SEE THE GEM https://github.com/terry90/user_notif
# config/application.rb
config.autoload_paths += %W(#{config.root}/app/models/notifications)
# frozen_string_literal: true
require 'yaml'
require 'erb'
require 'active_record'
config_dir = File.expand_path('../', __FILE__)
config_content = File.read(File.join(config_dir, 'database.yml'))
db_conf = YAML.safe_load(ERB.new(config_content).result)
@terry90
terry90 / init.coffee
Created June 13, 2017 13:45
Rubocop autocorrection on Atom (simple version but works really good)
# Add this to init.coffee in ~/.atom/
{BufferedProcess} = require 'atom'
rubocopOutput = (data) ->
if (data.stderr)
atom.notifications.addError(data.stderr)
return
if (data.summary.offense_count == 0)
atom.notifications.addSuccess('No offenses found')
for file in data.files
@terry90
terry90 / extensions.json
Last active March 15, 2018 10:21
VS Code config
[
{
"id": "Angular.ng-template",
"name": "ng-template",
"publisher": "Angular",
"version": "0.1.9"
},
{
"id": "CoenraadS.bracket-pair-colorizer",
"name": "bracket-pair-colorizer",
FROM rustlang/rust:nightly-slim as build
# Dependencies cache
WORKDIR /app/
COPY Cargo.toml .
COPY Cargo.lock .
RUN mkdir src
RUN echo "fn main() {}" > src/main.rs
@terry90
terry90 / Dockerfile
Last active June 5, 2024 20:24
Rust Dockerfile to build really small containers with postgres and SSL (~20Mo with rocket and diesel). Dependencies are cached for faster builds.
FROM clux/muslrust as build
WORKDIR /app/
# Deps caching begins
COPY Cargo.toml .
COPY Cargo.lock .
RUN mkdir src
RUN echo "fn main() {}" > src/main.rs
@terry90
terry90 / unfollow.js
Last active May 13, 2024 10:32
LinkedIn mass unfollow
const SPEED = 150 // ms
// Open the console and paste this on linkedin.com/feed/following
function unfollowCurrent(elems, callback) {
console.log('Unfollowing ', elems.length, ' contacts')
elems.forEach(
(e, i) =>
setTimeout(() => e.click(), i * SPEED)
)
setTimeout(callback, elems.length * SPEED)
@terry90
terry90 / .zshrc
Last active June 24, 2019 11:54
Zsh RC
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="spaceship"
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
zsh-completions
)
@terry90
terry90 / setup_manjaro.sh
Last active June 24, 2019 11:55
Manjaro Setup
#!/usr/bin/zsh
chsh -s $(which zsh)
sudo pacman -Syu
sudo pacman -S bat --noconfirm
sudo pacman -S lsd --noconfirm
sudo pacaur -S nerd-fonts-source-code-pro --noconfirm --noedit
sudo pacman -S code --noconfirm
sudo pacman -S pacaur --noconfirm
@terry90
terry90 / gcloud.sh
Created March 8, 2019 12:09
Manjaro Setup (gcloud)
#!/usr/bin/zsh
gcloud auth login
gcloud auth configure-docker
gcloud config set compute/zone europe-west1-b
gcloud config set compute/region europe-west1
echo "Cluster name?"
read "cluster?: "