Skip to content

Instantly share code, notes, and snippets.

View Drowze's full-sized avatar

R Gibim Drowze

View GitHub Profile
@kakra
kakra / 20-natural-scrolling.conf
Created April 21, 2017 17:00
xorg.conf.d/20-natural-scrolling.conf
Section "InputClass"
Identifier "Enable natural scrolling by default"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
MatchDriver "libinput"
Option "NaturalScrolling" "on"
EndSection
@batmat
batmat / get-jenkins-build-time.groovy
Last active November 16, 2021 14:03
Quick Jenkins system groovy script to compute how many minutes of build you had in the last N hours
def numberOfHoursBack = 7*24
def totalBuildTime =
Jenkins.instance.getItems(Job.class).collect { job ->
job.getBuilds().byTimestamp(System.currentTimeMillis()-numberOfHoursBack*60*60*1000, System.currentTimeMillis())
}
.flatten()
.collect { build -> build.getDuration() }
.sum()
@jdpace
jdpace / plex-trailiers.sh
Last active November 23, 2021 23:40
Plex trailers
#!/opt/bin/bash
# downloads all missing trailers - it goes through all your movies and matchs them up with an entry
# in plex, grabs the imdb id from plex, and then parses the trailer url from the imdb site, then passes
# that to youtube-dl to download the trailer, it skips entries that dont have a matching imdb entry
# or if the trailer already exists
# must have 'sqlite3' and 'youtube-dl' packages (apt-get install sqlite3 youtube-dl)
# set 'mpath' and 'pms' accordingly
export mpath="/volume1/video/Movies/";
export pms="/volume1/Plex/Library/Application Support/Plex Media Server/"; \
@MarcoWorms
MarcoWorms / autotinder.js
Last active April 23, 2022 15:18
Tinder Dislike Signos Persons
const Latinise={};Latinise.latin_map={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":"E","Ȅ":"E","È":"E","Ẻ":"E","Ȇ":"E","Ē":"E","Ḗ":"E","Ḕ":"E","Ę":"E","Ɇ":"E","Ẽ":"E","Ḛ":"E","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"H","Ȟ":"H","Ḩ":"H","Ĥ":"H","Ⱨ":"H","Ḧ":"H","Ḣ":"H","Ḥ":"H","Ħ":"H","Í":"I","Ĭ":"I","Ǐ":"I","Î":"I","Ï":"I","Ḯ":"I","İ":"I","Ị":"I","Ȉ":"I
#!/usr/bin/env ruby
class A
def b
'b'
end
end
module X
def b
@kaleb
kaleb / aliases
Created October 15, 2011 15:51
Gmail on Mutt
#~/.mutt/aliases
alias nick Nicholas Levandoski <nick.levandoski@auglug.org>
alias tim Timothy Pitt <timothy.pitt@auglug.org>
alias steven Steven Jackson <sjackson@auglug.org>
alias kaleb Kaleb Hornsby <kaleb.hornsby@auglug.org>
alias alug-admin nick, tim, steven
@jcasimir
jcasimir / sessions_and_conversations.markdown
Created September 11, 2011 23:07
Sessions and Conversations in Rails 3

Sessions and Conversations

HTTP is a stateless protocol. Sessions allow us to chain multiple requests together into a conversation between client and server.

Sessions should be an option of last resort. If there's no where else that the data can possibly go to achieve the desired functionality, only then should it be stored in the session. Sessions can be vulnerable to security threats from third parties, malicious users, and can cause scaling problems.

That doesn't mean we can't use sessions, but we should only use them where necessary.

Adding, Accessing, and Removing Data

@odlp
odlp / bundler-rspec-inline.rb
Created August 9, 2018 09:43
Inline Bundler and autorun RSpec
require "bundler/inline"
gemfile do
gem "rspec"
end
require "rspec/autorun"
RSpec.describe "inline Bundler and autorun RSpec" do
it "is convenient for self-contained examples & bug repros" do
@p1nox
p1nox / postgresql_configuration_on_ubuntu_for_rails.md
Last active November 29, 2023 04:38
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@TertiumQuid
TertiumQuid / paged_scope.rb
Created May 12, 2011 14:09
Quick and Dirty Rails Pagination Extension With Scope
module ActiveSupport
module PagedScope
def self.extended(base)
base.scope :paginated, lambda { |page,per_page|
page ||= 0
per_page ||= 25
base.limit( per_page.to_i ).offset( per_page.to_i * page.to_i )
}
end