Skip to content

Instantly share code, notes, and snippets.

View musaffa's full-sized avatar

Ahmad Musaffa musaffa

  • Bangladesh
View GitHub Profile
@Therises
Therises / fix_mic_lenovo320.md
Last active May 14, 2024 17:21
Fix microphone on Lenovo IdeaPad 320 on Ubuntu 18.04

In /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf and /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf:

  • Under [Element Internal Mic Boost] set volume to zero.
  • Under [Element Int Mic Boost] set volume to zero.
  • Under [Element Mic Boost] set volume to zero

Find your source name from the following command; mine is alsa_input.pci-0000_00_1f.3.analog-stereo

  $ pacmd list-sources | grep 'name:.*input'

Edit /etc/pulse/default.pa and add the following lines, where INPUT_NAME is name of the input source from above step:

@bkildow
bkildow / graduation_form.rb
Last active January 15, 2017 16:01
Reform 1.2.6 nested form (with support for cocoon gem)
# app/forms/graduation_form.rb
require 'concerns/nested_form'
class GraduationForm < Reform::Form
# Needed for correct behavior of virtual attributes, see https://github.com/apotonick/reform/issues/75
reform_2_0!
model :response
@sandcastle
sandcastle / install-teamcity.md
Last active December 7, 2023 18:02
Install TeamCity 9.0.3 on Ubuntu with Nginx
@markbao
markbao / ckeditor.rake
Created September 4, 2013 01:48
Rails 4 asset pipeline support for the CKEditor gem.
require 'fileutils'
desc "Create nondigest versions of all ckeditor digest assets"
task "assets:precompile" => :environment do
fingerprint = /\-([0-9a-f]{32})\./
for file in Dir["public/assets/ckeditor/**/*"]
# Skip file unless it has a fingerprint
next unless file =~ fingerprint
# Get filename of this file without the digest
@nilbus
nilbus / gist:6385142
Last active February 23, 2016 23:35 — forked from ryanlecompte/gist:1420133
Ruby multiple callbacks
# alternative to what is explained in the article Ruby Blocks as Dynamic Callbacks:
# http://www.mattsears.com/articles/2011/11/27/ruby-blocks-as-dynamic-callbacks
class Callbacks
def initialize(block)
block.call(self)
end
def callback(message, *args)
callbacks[message].call(*args)