Skip to content

Instantly share code, notes, and snippets.

View atleastimtrying's full-sized avatar

Anders Fisher atleastimtrying

View GitHub Profile
class window.VIA.Controller.ElememtControllerSwitcher
constructor: (@documentController)->
@controller = null
@textController= new VIA.Controller.TextController @document
@imageController= new VIA.Controller.ImageController @document
@continuationController = new VIA.Controller.ContinuationController @document
@buildEvents 'edit', 'startEdit', 'exit', 'pretendToBeEditing', 'stopPretending'
buildEvents: (arr)->
@[label] = @delegate(label) for label in arr
@atleastimtrying
atleastimtrying / gist:5353332
Created April 10, 2013 09:56
twitter intent as CS with jquery
window.twttr = ->
$('head').append('<script src="//platform.twitter.com/widgets.js" id="twitter-wjs"></script>') unless $ 'script#twitter-wjs'
window.twttr or (t =
_e: []
ready: (f)-> t._e.push f
)
@atleastimtrying
atleastimtrying / gist:5451944
Last active December 16, 2015 14:49
horrid index function
def index
@titles = Title.all
@genders = Gender.all
if not params[:find_by_student_id].blank?
@found_student = Student.find(params[:find_by_student_id])
else
if(params.size > 4)
if params[:title_id].present?
@results = @results || Student
@results = @results.where('title_id = ? ', params[:title_id])
@atleastimtrying
atleastimtrying / gist:5468463
Last active December 16, 2015 17:09
Drying this up
def regions_with_country_ids_for_select(collection)
response = []
collection.each do |item|
response << [item.name, item.id, :"data-parent_id" => region.country_id]
end
response
end
def referral_origins_for_select(collection)
response = []
@atleastimtrying
atleastimtrying / gist:7660554
Created November 26, 2013 15:36
multi touch drag the dots
pos = [0,0]
origin = [0,0]
init = ->
$('.dot').on 'touchstart': startDrag
startDrag = (event)=>
dot = $ event.currentTarget
dot.on
'touchmove': moveDrag
'touchend': endDrag
offset = dot.offset()
<?php
require 'includes/mapData.php';
?>
var map;
var living1 = new google.maps.LatLng(37.3333, -121.9000);
var MY_MAPTYPE_ID = 'custom_style';
@atleastimtrying
atleastimtrying / diatribe.txt
Last active August 29, 2015 13:56
The mistakes of 'code', 'hacker' and 'hacking'.
The mistakes of the words 'code', 'hacker' and 'hacking'
========================================================
As someone who habitually and professionally spends time writing computer programs and web sites using
a variety of programming languages, there are a few phrases that irk me as I feel that they poorly
represent the joyful, creative experience that is creating systems within a computer. The majority of
my issues are based around the associated semantics of the words used.
---
'code' - A code is something written to conceal or hide away. it is something that is secret to be
broken or discovered. Writing computer programs is primarily a means of expressions of ideas,
instructions or intents. These instructions are increasingly written to be more and more legible to
//measure the quality of life of workforce and supply chain
//measure level of employment/unemployment in area of development.
//measure creation of new work/supporting societites
//values available about companies
//the mission of the company
//description of the outputs of the company gives evidence of direction towards the mission
//outcomes +ve
// how the intended changes have been enacted and the results of these.
// impact -ve (usually)
// additional information on how the mission has changed the world.
class window.FAdminForm
PREFILL_CONTENT =
general_news:
title: 'General News'
body: '<p><strong><a href=""></a></strong> have </p>
<p></p>
<p></p>
<p><strong>See Also: <a href="URL">TITLE</a></strong><br/>
<strong>See Also: <a href="URL">TITLE</a></strong></p>'
seo_title: 'Page Title: | News | The 405'
PREFILL_CONTENT =
general_news:
title: 'General News'
body: '<p><strong><a href=""></a></strong> have </p>
<p></p>
<p></p>
<p><strong>See Also: <a href="URL">TITLE</a></strong><br/>
<strong>See Also: <a href="URL">TITLE</a></strong></p>'
seo_title: 'Page Title: | News | The 405'
seo_keywords: 'music news, the 405, news'