Skip to content

Instantly share code, notes, and snippets.

@nickbrowne
nickbrowne / mint17mba.md
Last active May 18, 2016 02:06
Mint 17 on 2013 Macbook Air

Backlight

Install https://github.com/patjak/mba6x_bl

Add xorg config (/usr/share/X11/xorg.conf.d/20-intel.conf):

Section "Device"
        Identifier  "Intel Graphics"
        Driver      "intel"
 Option "Backlight" "mba6x_backlight"
@nickbrowne
nickbrowne / arduino.sublime-build
Created November 21, 2015 07:33
Compile and upload current file without IDE
{
"cmd": "arduino_debug --upload $file"
}
xinput list

Get name of device, get properties

xinput list-props "Logitech Unifying Device. Wireless PID:101a"

Get name of accel profile property, set it

xinput set-prop "Logitech Unifying Device. Wireless PID:101a" "Device Accel Profile" -1

Add to .bashrc or whatever

Cinnamon seems to override any xorg, nvidia-settings or xrandr in .profile, the (obscure) way to set the refresh rate permanently is:

  1. Set resolution and refresh rate via nvidia-settings as normal
  2. Open Cinnamon "Display" settings, "detect display", apply changes
  3. Restart
{
"always_show_minimap_viewport": true,
"auto_indent": true,
"binary_file_patterns":
[
"*.cache",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",

Select the verts, press P

Separate by selection

Select child, then parent, CTRL+P, keep transform

@nickbrowne
nickbrowne / vidtogif
Created February 5, 2016 06:03
a quick and dirty video to gif converter
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
def filename
ARGV[0].rpartition('.').first
end
`ffmpeg -i #{ARGV[0]} -vf scale=320:-1 -f image2pipe -vcodec ppm - | convert -layers Optimize -delay 5 -loop 0 - #{filename}.gif`
trap(:USR2) {
  Thread.list.each do |t|
    puts "#" * 90
    p t
    puts t.backtrace
    puts "#" * 90
  end
}
@nickbrowne
nickbrowne / turbodev.rb
Created February 23, 2016 05:14
Reminder to try TurboDev from discourse
module Middleware
# Cheat and bypass Rails in development mode if the client attempts to download a static asset
# that's already been downloaded.
#
# Also ensures that assets are not cached in development mode. Around Chrome 29, the behavior
# of `must-revalidate` changed and would often not request assets that had changed.
#
# To use, include in your project and add the following to development.rb:
#
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install xserver-xorg-video-intel