Skip to content

Instantly share code, notes, and snippets.

@William-Lake
William-Lake / HowTo.md
Created January 7, 2018 13:35
How to send an email via mutt in a bash script on a recurring basis with crontab.

How to send an email via mutt in a bash script on a recurring basis with crontab.

This was suprisingly difficult for me, so I'm making this quick guide so I have it handy in the future.

Steps

  1. Set up mutt using this guide
  2. Create your bash script that will be sending emails using mutt.
  3. When creating your bash script, add the following line to your mutt command:
@prasadsilva
prasadsilva / fresh-chrome-with-custom-tz.sh
Last active October 8, 2024 12:47 — forked from stuartsierra/fresh-chrome.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, user config and custom Timezone
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@ianmustafa
ianmustafa / index.php
Last active April 5, 2023 19:45
Composer Autoload in CodeIgniter. This method provides Cmposer autoloader to be loaded before CodeIgniter classes. Useful to be used with dotenv file using PHP Dotenv package by josegonzalez.
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
@stevegraham
stevegraham / active_jerbz.rake
Created December 4, 2014 15:47
Run ActiveJobs with Sneakers
require 'sneakers/runner'
task :environment
namespace :sneakers do
desc "Start processing jobs with all workers"
task :work => :environment do
silence_warnings do
Rails.application.eager_load! unless Rails.application.config.eager_load
end
@zedar
zedar / GroovyHTTPBuilderChunkedResponse.md
Last active August 29, 2015 14:08
HTTPBuilder and chunked response

There is a bug in Groovy version up to 2.3.7. HTTPBuilder is not able to automatically parse chunked response to JSON format. If external server returns response with header:

Transfer-Encoding : chunked

Usually applied code:

def http = new HTTPBuilder(url)

def result = http.request(POST, JSON) { req ->

@ohryan
ohryan / responsive-align.less
Last active April 30, 2019 17:27
Bootstrap 3 Responsive Text Align
.text-xs-left { text-align: left; }
.text-xs-right { text-align: right; }
.text-xs-center { text-align: center; }
.text-xs-justify { text-align: justify; }
@media (min-width: @screen-sm-min) {
.text-sm-left { text-align: left; }
.text-sm-right { text-align: right; }
.text-sm-center { text-align: center; }
.text-sm-justify { text-align: justify; }
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Custom tasks
require 'capistrano/composer'
require 'capistrano/npm'
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@ozuma
ozuma / nochunk.cgi
Created July 24, 2013 05:30
Suppress "Transfer-Encoding: chunked" header and chunked body in CGI. (Apache, Perl)
#!/usr/bin/perl
use strict;
use warnings;
my $body = <<"EOM";
<html>
<head>
<title>title</title>
</head>
@dergachev
dergachev / prepend-timestamp.md
Last active September 28, 2016 14:56
shell snippet to prepend timestamp to command output

prepend-timestamp

Shell snippet that prepends a nice to a command's output.

For example, here's the (snipped) output of vagrant provision:

Successfully installed bundler-1.3.5  
1 gem installed  
Using rmagick (2.13.2)