Skip to content

Instantly share code, notes, and snippets.

View sha1sum's full-sized avatar

Anthony Atkinson sha1sum

  • GRIN, Inc.
  • Saint Petersburg, FL, United States
View GitHub Profile
require 'fileutils'
# Install the 'facter' gem if not already installed. Facter assists in automatically determining the RAM and CPUs
# to use for the VM.
facter_plugins = `vagrant plugin list | grep facter`.tr("\n","")
unless facter_plugins.length > 0
puts "The 'facter' gem is not yet installed; installing..."
system 'vagrant', 'plugin', 'install', 'facter'
end
atom.commands.add 'atom-text-editor', 'custom:vim-mode-and-core-cancel', ->
editor = atom.views.getView(atom.workspace.getActiveTextEditor())
atom.commands.dispatch(editor, 'vim-mode-plus:activate-normal-mode')
atom.commands.dispatch(atom.views.getView(atom.workspace), 'core:cancel')
@sha1sum
sha1sum / go.xml
Created March 26, 2016 13:02
GOlang File Format for Beyond Compare
<?xml version="1.0" encoding="UTF-8"?>
<!-- Produced by Beyond Compare 4 from Scooter Software -->
<!--
This is an extension of the work done by Nate Finch:
https://npf.io/2014/05/diffing-go-with-beyond-compare/
The regular expressions for identifiers have been updated
to match on lowercase and allow numbers to be included anywhere
after the first character of the word.
class Admin::Product < ActiveRecord::Base
require 'csv'
has_attached_file :image,
styles: { medium: "500x500>",
thumb: "200x200>" },
default_url: "/images/:style/missing.jpg"
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
update logs
set app_id = case when apps.id is not null then apps.id else 0 end
from logs l
left outer join apps
on l.app_name = apps.name
AND l.company_id = apps.company_id
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
........*.........................F.....FFFFF................................FFFFFFF..FF........................................................................F..........................................
Pending:
products admin user deleting product
# Not yet implemented
# ./spec/features/admin/products_spec.rb:40
@sha1sum
sha1sum / groupme.rb
Created February 12, 2015 16:07
Back Up a GroupMe Group's Images to a Folder
require 'uri'
require 'open-uri'
require 'fileutils'
require 'httparty'
# You will need to have HTTParty installed:
# https://github.com/jnunemaker/httparty
#
# Initialize with your access token:
# GroupMe.new('abcdefghijklmnopqrstuvwxyz')
@sha1sum
sha1sum / groupme_random_fact.php
Created December 15, 2014 20:10
Random Fact Generator for a GroupMe Bot (via callback URL)
<?php
/*
* Output a random fact to GroupMe via a bot.
*
* Trigger the bot with "!randomfact" or "!random fact".
* Enter the bot ID on line 43.
*
*/
@sha1sum
sha1sum / gist:368d6f3b4e2567b89411
Created November 13, 2014 13:08
Unicode GroupMe Emoji Replacement
function codePointAt(text, position) {
if (text == null) {
throw TypeError();
}
var string = String(text);
var size = string.length;
// `ToInteger`
var index = position ? Number(position) : 0;
if (index != index) { // better `isNaN`
index = 0;
@sha1sum
sha1sum / powerups.rb
Created November 13, 2014 12:47
GroupMe Powerups Initializer
powerups_url = "https://powerup.groupme.com/powerups"
unless Rails.env.test?
response = HTTParty.get(powerups_url)
if response.success?
::GroupMePowerUps = response['powerups']
else
::GroupMePowerUps = Array.new
end
else
::GroupMePowerUps = Array.new