Skip to content

Instantly share code, notes, and snippets.

View chrisortman's full-sized avatar

Chris Ortman chrisortman

View GitHub Profile
@GabLeRoux
GabLeRoux / fix-ssl-cert-snakeoil.key-ubuntu-postgresql.sh
Created April 1, 2016 06:39
Fix postgresql error FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
# > It happened to me and it turned out that I removed erroneously the postgres user from "ssl-cert" group, set it back with
gpasswd -a postgres ssl-cert
# Fixed ownership and mode
sudo chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
sudo chmod 740 /etc/ssl/private/ssl-cert-snakeoil.key
# now postgresql starts! (and install command doesn't fail anymore)
sudo /etc/init.d/postgresql start
@graemerocher
graemerocher / migrate-jira-to-github-issues.groovy
Last active March 26, 2024 00:09
JIRA to Github Issues Migration Script
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0')
@Grab(group='joda-time', module='joda-time', version='2.7')
import wslite.rest.*
import org.joda.time.*
import org.joda.time.format.*
import groovy.xml.*
import groovy.json.*
import static java.lang.System.*
import groovy.transform.*
@mikedamm
mikedamm / gist:d0ef2291a3c4eecdc35a
Created September 25, 2014 00:20
Remove McAfee Endpoint Security for Mac without uninstall password
rm -f /Library/LaunchAgents/com.mcafee.menulet.plist
rm -f /Library/LaunchAgents/com.mcafee.reporter.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.Eupdate.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.ScanFactory.plist
rm -f /Library/LaunchDaemons/com.mcafee.virusscan.fmpd.plist
rm -rf /Library/Application\ Support/McAfee
rm -rf /usr/local/McAfee
shutdown -r now
@hlissner
hlissner / replace.sh
Last active September 11, 2023 10:14
Bulk search & replace with ag (the_silver_searcher)
# ag <https://github.com/ggreer/the_silver_searcher>
# usage: ag-replace.sh [search] [replace]
# caveats: will choke if either arguments contain a forward slash
# notes: will back up changed files to *.bak files
ag -0 -l $1 | xargs -0 perl -pi.bak -e "s/$1/$2/g"
# or if you prefer sed's regex syntax:
ag -0 -l $1 | xargs -0 sed -ri.bak -e "s/$1/$2/g"
@glv
glv / experience_teaching_ruby_testing.md
Last active November 3, 2019 14:00
@tenderlove asked about the wisdom of teaching RSpec to new Ruby developers. I have some relevant experience. Here it is, for what it's worth.

Notes on teaching both test/unit and RSpec to new Ruby developers

@tenderlove asked "Is it good to teach RSpec (vs t/u) to people who are totally new to Ruby?" I have experience suggesting that it is a good thing; after a short back and forth, it seemed useful to write it up in detail.

Background

This goes back several years, to when I was the primary Ruby/Rails trainer for Relevance from 2006-2009. I'm guessing that worked out to probably 6-8 classes a year during those years. Since then, RSpec has changed a fair amount (with the addition of expect) and test/unit has changed radically (it has an entirely new implementation, minitest, that avoids some of the inconsistencies that made test/unit a bit confusing during the time I'm writing about here).

I started out as an RSpec skeptic. I've never been afraid of what a lot of people denigrate as "magic" in Ruby libraries … to me, if you take the trouble to understand it, that stuff's just pr

@TimMedcalf
TimMedcalf / tableViewKeyboardHandling.m
Last active July 5, 2021 12:18
The easy & reliable way of handling UITableView insets when the keyboard is shown. This works unchanged no matter where the table view is on the screen (including dealing with orientation, hierarchy, container view controllers & all devices)
/*
One of the first things someone new to iOS Development finds is that dealing with the keyboard is trickier
than they think it should be. Simply changing the scrolling extents of a UITableView (or UIScrollView, or
UICollectionView) that is partially covered by they keyboard reveals a lot about the internals of how iOS
works and highlights various "gotchas" that need to be considered.
There are various ways to know that a keyboard has been shown - but observing some specific notifications
provides a reliable way to allow you to modify your views to deal with it.
@dufferzafar
dufferzafar / Selections-Sublime.md
Created November 27, 2013 09:50
Selections and Multiple Cursors in Sublime Text 3

Selections and Multiple Cursors in Sublime Text 3

A handy list of selection shortcuts.

Here are the official docs: Keyboard and Mouse

Mouse

Building blocks:

  • Add to selection: Ctrl
  • Subtract from selection: Alt
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@joeriks
joeriks / sample.d.ts
Last active February 5, 2021 23:35
Generate Typescript Interfaces for all types (classes) within one assembly. 1. Add reference to your assembly within a project. 2. Create somename.tt file with below contents. 3. Insert your own assembly name in the tt file 4. Get the assembly with one of the types 5. Save the tt and the generator will create a interfacefile for you (somename.d.ts)
// Sample generation:
//
// Types in assembly: MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// Generated 01/28/2013 13:11:37
//
module myInterfaces {
//
// Type: MyAssembly.Models.Client
//
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#