Skip to content

Instantly share code, notes, and snippets.

View LeipeLeon's full-sized avatar
🕳️

Leon Berenschot LeipeLeon

🕳️
View GitHub Profile
@deviationist
deviationist / prevent-rekordbox-start-automatically.sh
Last active February 22, 2023 11:07
Prevent Rekordbox (v6.6.8) from starting on boot (for macOS)
# To prevent Rekordbox from starting during boot
: > ~/Library/LaunchAgents/com.pioneerdj.rekordboxdj.agent.plist && chflags uchg ~/Library/LaunchAgents/com.pioneerdj.rekordboxdj.agent.plist
# To undo the change
chflags nouchg ~/Library/LaunchAgents/com.pioneerdj.rekordboxdj.agent.plist
require "bundler/inline"
gemfile do
source 'https://rubygems.org'
gem "rspec", "~> 3.10"
end
require "rspec/autorun"
RSpec.configure do |config|
@wagenet
wagenet / application_policy.rb
Created May 6, 2021 21:25
Graphiti + Pundit
# frozen_string_literal: true
class ApplicationPolicy
attr_reader :user, :record
def initialize(user, record)
@user = user
@record = record
end
@kekru
kekru / git-copy-files-to-empty-branch.md
Last active February 26, 2024 05:51
git: Copy files to new branch without history, using a squash merge

Git: New branch with files but no history

This is how to copy your files from a given git branch to a new empty branch, using a squash merge.
This example will copy files from branch old-branch to target-branch

# First be sure, that you don't have uncommitted working changes. They will be deleted

# Checkout a new empty branch without history
git checkout --orphan target-branch
@WaKeMaTTa
WaKeMaTTa / Gemfile
Created October 17, 2016 12:07 — forked from remino/Gemfile
kramdown-rails: Use Kramdown (Markdown) in Rails 4
# Gemfile
gem 'kramdown'
@chrismdp
chrismdp / s3.sh
Last active September 13, 2024 12:53
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@rogercampos
rogercampos / delayed_versions.rb
Created January 10, 2013 08:20
carrierwave delayed version processing
module Carrierwave
module DelayedVersions
extend ActiveSupport::Concern
module ClassMethods
def delayed_versions
@delayed_versions ||= Set.new
end
def delayed_version(name, opts = {}, &block)
@jasonrudolph
jasonrudolph / about.md
Last active May 14, 2024 16:36
Programming Achievements: How to Level Up as a Developer
@Kilian
Kilian / annoying.js
Created January 6, 2011 15:04
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@filipsalo
filipsalo / .bashrc
Created July 14, 2010 21:30
If you ever forget to give grep some filenames and end up waiting while it waits for input, stuff this into your .bashrc.
# Call grep, with stdin closed if it is a terminal.
#
# Avoids the "eternal wait" problem when you've forgotten
# to specify a filename.
function grep { (tty -s && exec <&-; exec $(which grep) "$@"); }