Skip to content

Instantly share code, notes, and snippets.

View matthewford's full-sized avatar

Matthew Ford matthewford

View GitHub Profile
@bradgessler
bradgessler / LSP-tailwindcss.sublime-settings
Created August 1, 2023 04:01
TailwindCSS LSP for Phlex
// Settings in here override those in "LSP-tailwindcss/LSP-tailwindcss.sublime-settings"
{
"enabled": true,
"selector": "source.ruby | source.jsx | source.js.react | source.js | source.tsx | source.ts | source.css | source.scss | source.less | text.html.vue | text.html.svelte | text.html.basic | text.html.twig | text.blade | text.html.blade | embedding.php | text.html.rails | text.html.erb | text.haml | text.jinja | text.django | text.html.elixir | text.html.ngx",
"settings" : {
"tailwindCSS.experimental.classRegex": [
"class:\\s*\"([^\"]*)\""
],
}
@maccman
maccman / show.erb
Created December 26, 2016 23:37
Clearbit Reveal/Drift integration
drift.on('ready',function(api, payload) {
api.showWelcomeOrAwayMessage(<%== @options.to_json %>);
});
@danswick
danswick / index.html
Last active March 11, 2023 16:34
Clickable markers with popup content from GeoJSON
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.0/mapbox-gl.css' rel='stylesheet' />
<script src='parks.js'></script>
<style>
@vanwhale
vanwhale / gist:f74879e0549b67eb17bb
Last active February 18, 2018 18:54
circleci-parallel-codeclimate
#!/usr/bin/env ruby
require "codeclimate-test-reporter"
branch = ENV['CIRCLE_BRANCH']
node_index = ENV['CIRCLE_NODE_INDEX'].to_i
node_total = ENV['CIRCLE_NODE_TOTAL'].to_i
artifacts_dir = ENV['CIRCLE_ARTIFACTS']
coverage_dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage")
filename = '.resultset.json'
@KevinMcHugh
KevinMcHugh / test_for_query_risk_vuln.rb
Last active August 29, 2015 14:01
Tests for vulnerability to new Rails Unsafe Query Risk
# https://groups.google.com/forum/#!topic/rubyonrails-security/8CVoclw-Xkk
# be rails r test_for_query_risk_vuln.rb, no guarantee that it's perfect.
Rails.application.eager_load!
vulnerable = ActiveRecord::Base.descendants.map do |klass|
klass.to_s if klass.column_names.include? klass.to_s.underscore.pluralize
end.uniq
puts "Take a look at #{vulnerable}!!!!!!" unless vulnerable.compact.empty?
@keo
keo / bootstrap.sh
Last active January 25, 2024 15:49
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup
To get started with Docker/Marathon/Mesos, you need to install a
new Mesos, a new Marathon, and Deimos, the bridge to Docker.
You'll also need Docker and the JVM. These instructions are for
Ubuntu 13.10.
## Install Mesos prerequisites
:; sudo apt-get update
:; sudo apt-get install zookeeperd default-jre python-setuptools python-protobuf curl pip
## Install recent Mesos
@astrauka
astrauka / clone_rackspace_cloud_files.rb
Last active December 30, 2015 21:59
Ruby on Rails - clone Rackspace cloud files from one container to another. Supports different rackspace users. Add the file contents to app/tasks/clone_rackspace_cloud_files.rb and launch CloneRackspaceCloudFiles.new.run via console. Can use as non-rails script, but then need to make sure require "fog" finds the file required. Environment variab…
require "fog"
require "net/http"
class CloneRackspaceCloudFiles
def service
@service ||= Fog::Storage.new({
:provider => 'Rackspace',
:rackspace_username => ENV["RACKSPACE_USER_NAME"],
:rackspace_api_key => ENV["RACKSPACE_API"],
:rackspace_auth_url => Fog::Rackspace::UK_AUTH_ENDPOINT,
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

<style>
span.title {
display: block;
text-align: center;
margin-top: 10px;
margin-bottom: 20px;
}
</style>
<div data-role="page" id="sitetips" data-title="Dialog Tips">