Skip to content

Instantly share code, notes, and snippets.

@briankung
briankung / docker-pry-rails.md
Last active December 12, 2023 10:40
Using pry-rails with Docker

First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails

gem 'pry-rails', group: :development

Then you'll want to rebuild your Docker container to install the gems

@shibulijack-fd
shibulijack-fd / google_script.js
Created October 3, 2016 07:25
Google script to convert spreadsheet to YML
function getYAML() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var dest = DocumentApp.openById(PropertiesService.getScriptProperties().getProperty("output_document_id"));
var key = Browser.inputBox("Please enter the key of the Google Spreadsheet containing the content to be generated as a YAML file.");
var source = SpreadsheetApp.openById(key);
var output = "---\nen:\n";
var sheets = source.getSheets();
for (var i = 0; i < sheets.length; i++) {
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@andrew
andrew / labels.md
Last active December 20, 2021 16:16
Popular labels from issues and pull requests on open source GitHub repositories - Pulled from https://libraries.io
Label Count
auto-migrated 1062577
Priority-Medium 852268
Type-Defect 783536
enhancement 505553
bug 377913
Type-Enhancement 155995
question 102693
feature 60043
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@ahtcx
ahtcx / deep-merge.js
Last active April 29, 2024 17:13
Deep-Merge JavaScript objects with ES6
// ⚠ IMPORTANT: this is old and doesn't work for many different edge cases but I'll keep it as-is for any of you want it
// ⚠ IMPORTANT: you can find more robust versions in the comments or use a library implementation such as lodash's `merge`
// Merge a `source` object to a `target` recursively
const merge = (target, source) => {
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
for (const key of Object.keys(source)) {
if (source[key] instanceof Object) Object.assign(source[key], merge(target[key], source[key]))
}
@ryantuck
ryantuck / ansible-localhost.md
Last active April 3, 2024 15:21
super fast way to start testing ansible stuff locally without VMs

set up ansible to work on localhost

i've found this useful for debugging ansible modules and syntax without having to use VMs or test in dev environments.

install ansible

pip install ansible

make some relevant config files

@fabiomaggio
fabiomaggio / ckeditor-responsive-images.js
Created January 22, 2016 19:10
Make inserted images in CKEditor automatically responsive
// If you want inserted images in a CKEditor to be responsive
// you can use the following code. It creates a htmlfilter for the
// image tag that replaces inline "width" and "style" definitions with
// their corresponding attributes and add's (in this example) the
// Bootstrap "img-responsive" class.
CKEDITOR.on('instanceReady', function (ev) {
ev.editor.dataProcessor.htmlFilter.addRules( {
elements : {
img: function( el ) {
// Add bootstrap "img-responsive" class to each inserted image