Skip to content

Instantly share code, notes, and snippets.

View asgeo1's full-sized avatar

Adam George asgeo1

View GitHub Profile
@bbqtd
bbqtd / macos-tmux-256color.md
Last active April 24, 2024 01:28
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@czj
czj / Gemfile
Last active August 28, 2022 09:06
Outputting Rails app logs to Logz.io via logstash
gem "lograge"
gem "logstash-event"
gem "logstash-logger"
@oinak
oinak / Dockerfile
Last active June 26, 2022 00:47 — forked from anonymous/Dockerfile
Example docker config for rails develompent
FROM ruby:2.4
## In case of postgresql for heroku:
# RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/postgeresql.list \
# && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
# && apt-get update \
# && apt-get update \
# && apt-get install -y --no-install-recommends \
# postgresql-client-9.6 pv ack-grep ccze unp htop vim \
# && rm -rf /var/lib/apt/lists/* \
@hubertursua
hubertursua / node-forever-upstart.conf
Last active December 7, 2018 17:53
NodeJS, Forever, and Upstart (Ubuntu)
#!upstart
start on filesystem and started networking
stop on shutdown
expect fork
setuid ubuntu
env HOME="/home/ubuntu"
@iamatypeofwalrus
iamatypeofwalrus / add_milliseconds_to_mysql_and_activerecord_timestamps.md
Last active February 2, 2024 15:38
ActiveRecord: Store Milliseconds (or Microseconds) in Timestamps/Datetimes with Rails / MySQL

ActiveRecord: Store Milliseconds (or Microseconds) in Timestamps with Rails / MySQL

Milliseconds in your Timestamps.

We got 'em, you want 'em.

Why

Shit needs to be PRECISE

LICENSE

MIT

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@slashdevsda
slashdevsda / gist:5858233
Created June 25, 2013 12:58
basic systemd unit for nodeJS, using forever. with mongodb dep.
[Unit]
Description=Start Node.js Service
Requires=network.target mongodb.service
After=network.target
[Service]
Type=forking
WorkingDirectory=/srv/node/
ExecStart=/usr/bin/forever start --pidFile /srv/node/nodeserialskiller.pid /srv/node/server.js
ExecStop=/usr/bin/forever stop /srv/node/server.js
@nathancolgate
nathancolgate / Gemfile
Last active January 31, 2023 01:44
How I built a rails interface on top of the amazing IceCube ruby gem. Video of final product: http://youtu.be/F6t-USuWPag
# Add these two gems
gem 'ice_cube', '0.9.3'
gem 'squeel', '1.0.16'
@Dianoga
Dianoga / node.service
Created December 13, 2012 15:51
systemd .service file for node.js app. Requires forever.
[Unit]
Description=Start Herir Node.js Service
Requires=network.target
After=network.target
[Service]
Type=forking
WorkingDirectory=/srv/hereir/node
ExecStart=/usr/bin/forever start --pidFile /var/run/hereir.pid HereIR.js
ExecStop=/usr/bin/forever stop HereIR.js
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"