Skip to content

Instantly share code, notes, and snippets.

@jferris
jferris / configmap.yaml
Last active October 28, 2024 01:42
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"
@aquaflamingo
aquaflamingo / twbs_rails6.md
Last active December 10, 2020 00:12
Twitter Bootstrap Rails 6

Adding Twitter Bootstrap to Rails 6

See also: https://blog.robsdomain.com/twitter-bootstrap-in-rails-6/

Rails 6 mades large changes to how asset compilation is done. In specific sprockets has been removed for javascript processing and replaced with the common webpack utility. Sprockets remains in usage for CSS processing.

When it comes to asset bundling, the "Rails way" is webpack for JavaScript and Sprockets for everything else. The default setup in a fresh Rail 6 install, similar to what Basecamp uses, still compiles CSS, images, and fonts with Sprockets.

This means, if you're a member of the Basecamp camp, all your webpack JavaScript source files would live in app/javascript and all your Sprockets CSS and images would remain in app/assets. Running rails assets:precompile will first build all the Sprockets assets into the public/assets directory, then will build all the webpack assets into the public/packs directory.

@castwide
castwide / rails.rb
Last active October 24, 2024 16:26
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base
@brentpicasso
brentpicasso / RaceCapture_simple_Lua_CAN_bus_analyzer.lua
Last active April 22, 2022 21:24
Simple CAN bus analyzer for RaceCapture using Lua scripting
-- Simple CAN bus analyzer
-- This script is useful for reverse engineering CAN bus data
-- and detecting patterns.
--
-- Up to 100 individual 8 bit channels can be created. Additional channels will not be tracked.
-- CAN bus data will appear in the data stream with the channel name: <CAN ID>_<OFFSET>
-- Once script is running, you can monitor the data under Dashboard / Raw Channels View.
----------------------------------------
--Configuration
@bjornvaktaren
bjornvaktaren / minimal_spi.cpp
Last active April 27, 2024 14:04
Simple SPI example with libftdi and FTDI UM232H
// Quite minimal example showing how to configure MPSSE for SPI using libftdi
// compile like this: g++ minimal_spi.cpp -o minimal_spi -lftdipp -lftdi
#include <ftdi.hpp>
#include <usb.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
// UM232H development module
#define VENDOR 0x0403
@nlhkabu
nlhkabu / cheatsheet.md
Last active April 8, 2019 23:31
Nicole's PeopleAsk Env CheatSheet

LXC

List all containers:

sudo lxc-ls -f

Stop peopleask container:

sudo lxc-stop -n peopleask

@kostaz
kostaz / gist:6ce4034192ac3a0f08ec3e279c81d0b8
Created April 23, 2017 06:02 — forked from naodesu/gist:10620506
How to mount ubifs image in Linux.
# $UBIFS is ubifs image file
# make sure $IMAGE is a ubifs image file
blkid $(IMAGE)
$(IMAGE): ... TYPE="ubifs"
# size of created mtd is 256.0 MiB
modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x90 fourth_id_byte=0x95
flash_erase /dev/mtd0 0 0
ubiformat /dev/mtd0 -s 2048 -O 2048
modprobe ubi

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
@tuxfight3r
tuxfight3r / sfdisk.sh
Created March 6, 2017 16:01
use sfdisk to create scripted partitions
##create one big partition
echo ';' | sfdisk /dev/sdc
##create one big partition with specific partition type
#creates W95 FAT32 (LBA)
echo ',,c;' | sfdisk /dev/sdd
#creates lvm type
echo ',,8e;' | sfdisk /dev/sdd
@aaronhoffman
aaronhoffman / git-bc.cmd
Created March 2, 2017 02:50
Configure Beyond Compare 4 as git diff tool on windows 10
git config --global diff.tool bc
git config --global difftool.bc.path "C:\Program Files\Beyond Compare 4\BComp.exe"
git config --global merge.tool bc
git config --global mergetool.bc.path "C:\Program Files\Beyond Compare 4\BComp.exe"
git config --global alias.mydiff "difftool --dir-diff --tool=bc --no-prompt"