Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
@michaelmrose
michaelmrose / compton.conf
Created October 2, 2015 21:20
transparent windows i3-bar and i3 frames
opacity-rule = [
"93:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
"90:class_g = 'Qvim' && !_NET_WM_STATE@:32a",
"95:class_g = 'Zathura' && !_NET_WM_STATE@:32a",
"95:class_g = 'Spacefm' && !_NET_WM_STATE@:32a",
"88:class_g = 'LilyTerm' && !_NET_WM_STATE@:32a",
"80:class_g = 'i3-bar' && !_NET_WM_STATE@:32a",
"50:class_g = 'i3-frame' && !_NET_WM_STATE@:32a",
"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];
@taylorSando
taylorSando / clj-material-ui
Last active November 18, 2016 11:06
How to use material ui with om
(ns om-material-ui.core
(:require [clojure.string :as str]
[om-tools.dom :as omt]))
(defn kebab-case
"Converts CamelCase / camelCase to kebab-case"
[s]
(str/join "-" (map str/lower-case (re-seq #"\w[a-z]+" s))))
(def material-tags
(defrecord Server [service-map]
component/Lifecycle
(start [component]
(info :msg "Starting server.")
(let [server (bootstrap/create-server (:service-map service-map))]
(bootstrap/start server)
(assoc component :server server)))
(stop [component]
(info :msg "Stopping server.")
(update-in component [:server] bootstrap/stop)))
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@mfilippov
mfilippov / gist:10009192
Last active December 4, 2021 13:11
Netty multicast demo.
package me.filippov.netty_demo;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ChannelFactory;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.DatagramPacket;
import io.netty.channel.socket.InternetProtocolFamily;
import io.netty.channel.socket.nio.NioDatagramChannel;

How to inform Eclipse and other Mac applications of the command line PATH

  1. Update Mac OS X's notion of PATH.
$ defaults write ~/.MacOSX/environment PATH "`echo $PATH`"
$ echo "setenv PATH $PATH" | sudo tee /etc/launchd.conf
  1. Restart Mac OS X.
@bubenkoff
bubenkoff / checkpoint.sh
Last active February 14, 2024 21:38
Endpoint Security VPN FULL start/stop script for Mac OS X
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.
@joshuap
joshuap / deploy.rb
Created October 7, 2012 01:19
Honeybadger deployment notification capistrano task using local machine and curl
namespace :deploy do
desc "Notifies Honeybadger locally using curl"
task :notify_honeybadger do
require 'json'
require 'honeybadger'
begin
require './config/initializers/honeybadger'
rescue LoadError
logger.info 'Honeybadger initializer not found'
@jcf
jcf / bootstrap.sh
Created April 3, 2012 16:17
Bootstrap a Ruby app that uses Bundler
#!/bin/bash
echo "Checking for Ruby..."
type -P ruby &>/dev/null || { echo >&2 "Ruby not found in PATH. Exiting."; exit 1; }
echo "Checking for Bundler..."
gem which bundler &>/dev/null || gem install bundler
echo "Installing gem dependencies..."
bundle install
@blacktaxi
blacktaxi / ruby-fmt.clj
Created January 25, 2012 14:42
Ruby-like string interpolation in Clojure
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))