Skip to content

Instantly share code, notes, and snippets.

View blackjk3's full-sized avatar

Jason Kadrmas blackjk3

  • KadrmasConcepts
  • Minneapolis, MN
View GitHub Profile
@blackjk3
blackjk3 / mongo-install.txt
Last active August 29, 2015 14:01
Mongo Install
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org
# Running Mongo
service mongod start
sudo /etc/init.d/mongod start
# Stopping Mongo
@blackjk3
blackjk3 / grunt.md
Last active January 1, 2016 03:19
Grunt startup

Install Grunt for Sass and JST automation

$ npm install -g grunt-cli

Create package.json

{
    "name" : "SampleGrunt",
    "version" : "0.1.0",
    "author" : "Brandon Random",
 "private" : true,
@blackjk3
blackjk3 / gist:7946199
Last active December 31, 2015 06:18
RailsBuilder snippet
<div class="rails-builder-snippet">
<iframe src="/rails_builder?request=<%= request.uuid %>" id="rails-builder-iframe" scrolling="no" seamless="seamless" style="position:absolute; width: 400px; height: 100%; right: 0; top: 0; z-index: 9999999; overflow-y: hidden;"></iframe>
</div>
<div id="rails-builder-selected-element" style="position:absolute;top:0;left:0;border: 1px solid grey; background: rgba(0,131,204,0.5);"></div>
<script type="text/javascript">
var RailsBuilder = RailsBuilder || {};
RailsBuilder.request_id = "<%= request.uuid %>";
;(function () {
$(function() {
@blackjk3
blackjk3 / gemproject.md
Last active February 24, 2018 15:10
Creating a gem project with rspec

** Create the plugin without test-unit and specify the path for the dummy application:

rails plugin new $project_name --skip-test-unit --dummy-path=spec/dummy --mountable

** Add rspec-rails as a development dependency to the gemspec file (foobar.gemspec):

Gem::Specification.new do |s|
@blackjk3
blackjk3 / geoutils.js
Last active December 29, 2015 14:19
Calculating a bounding box based on a single geo point.
var GeoUtils = {
MIN_LAT: -90 * Math.PI/180, // -PI/2
MAX_LAT: 90 * Math.PI/180, // PI/2
MIN_LON: -180 * Math.PI/180, // -PI
MAX_LON: 180 * Math.PI/180, // PI
computeBoundingCoordinates: function(coords, distance, radius) {
radius = 6371.01; // Size of the earth in kilometers
@blackjk3
blackjk3 / gist:6718377
Last active December 24, 2015 00:40
PhoneGap basic startup
# Create Project
phonegap create ~/Documents/phonegap/ProjectName --id "com.kadrmasconcepts.projectname" --name "ProjectName"
# Add Platforms
cordova platform add ios
cordova prepare
# Add Plugins
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git
cordova plugin add git://github.com/blackjk3/PhoneGap-LowLatencyAudio-iOS.git
@blackjk3
blackjk3 / gist:6715861
Created September 26, 2013 15:31
Oracle PATH variables
# Oracle
export NLS_LANG="AMERICAN_AMERICA.UTF8"
export ORACLE_HOME=/opt/oracle/instantclient
export DYLD_LIBRARY_PATH=$ORACLE_HOME
export LD_LIBRARY_PATH=/opt/oracle/instantclient
export SQLPATH=/opt/oracle/instantclient
export TNS_ADMIN=/opt/oracle/network/admin
export PATH=$PATH:$ORACLE_HOME
export PATH=$PATH:$DYLD_LIBRARY_PATH
@blackjk3
blackjk3 / CSS Snippets.css
Created September 10, 2013 17:33
CSS Snippets
/* 1. Sidebar list slide out */
.sidebar {
position: absolute;
overflow: scroll;
-webkit-overflow-scrolling: touch;
background-color: #313134;
border-left: 2px solid #202022;
/* Initially Hidden */
@blackjk3
blackjk3 / Database statements
Created August 19, 2013 19:54
Database statements
SELECT ID , stop_name, ST_Distance_Sphere(
ST_GeomFromText('POINT(' || stop_lon || ' ' || stop_lat || ')'),
ST_GeomFromtext('POINT(-93.2446454 44.9723784)')
), stop_lat, stop_lon
FROM STOPS
order by 3
limit 10;
insert into stops
(stop_code, stop_name, stop_desc, stop_lat, stop_lon, zone_id, stop_street, stop_city, stop_region, stop_postcode, stop_country)
@blackjk3
blackjk3 / gist:6177127
Created August 7, 2013 18:42
Ember Starter with rest.
App = Ember.Application.create({
rootElement: '.affix-container',
ready: function() {
console.log('ember ready');
App.requestController = App.RequestController.create();
}
});
DS.RESTAdapter.reopen({
namespace: 'portal/requests/api'