Skip to content

Instantly share code, notes, and snippets.

View oskarrough's full-sized avatar
💭
██████

Oskar oskarrough

💭
██████
View GitHub Profile
@zoras
zoras / launch_sublime_from_terminal.markdown
Created June 21, 2012 04:29 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@desandro
desandro / transition-scroll-to.js
Created December 4, 2012 16:50
Use CSS transitions to scroll to element
( function( window, undefined ) {
'use strict';
// helper function
function capitalize( str ) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
// ========================= getStyleProperty by kangax ===============================
@tim-evans
tim-evans / document_title.js
Created August 22, 2014 19:28
Document title mixin for Ember.Router
import Ember from "ember";
var get = Ember.get;
var copy = Ember.copy;
var removeObserver = Ember.removeObserver;
var addObserver = Ember.addObserver;
var DocumentTitleMixin = Ember.Mixin.create({
titleTokensDidChange: function () {
@lutzissler
lutzissler / jquery.realwidth.js
Created October 14, 2013 12:50
jQuery realWidth plugin. Returns the real (sub-pixel, non-rounded) width of an element as stored internally in the browser. Thanks to ssorallen for the hint. See http://stackoverflow.com/questions/3603065/do-not-round-width-in-jquery#16072668 for context.
(function ($) {
$.fn.realWidth = function () {
var els = $(this);
return els.length ? els[0].getBoundingClientRect().width : null;
}
})(jQuery);
@elithrar
elithrar / history.js
Last active January 10, 2016 14:03
smartScroll for Ember.js - reset the scroll position on forward transitions you haven't previously visited - via @rwjblue on embercommunity.slack.com
// app/locations/history.js
export default Ember.HistoryLocation.extend({
pushState() {
this._super(...arguments);
window.scrollTo(0, 0);
}
});
```​
@planetcrypton
planetcrypton / text-2-html-test.js
Last active February 22, 2016 08:55
Ember JS Helper for converting parts of a text (non-mark-down) to HTML whenever certain patterns are recognized
/**
* $ ember test --filter "text-2-html"
*/
import { text2Html } from '../../../helpers/text-2-html';
import { module, test } from 'qunit';
module('Unit | Helper | text 2 html');
const input = "Hey\nHow're ya doin'?\nSorry you can't get through.\nWhy don't you leave me your name, mine is @planetcrypton, and your number, mine is +4512345678, and I'll get back to you.\nDon't forget to visit http://www.wearedelasoul.com/\nMail me at plug2@reversed-yogurt.com #oldschool #plug1 #plug2 #plug3";
@cowboy
cowboy / Cowboy - Presentation.tmTheme
Created November 29, 2012 19:55
Sublime / TM theme I use for presentations.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Jacob Rus</string>
<key>comment</key>
<string>Created by Jacob Rus. Based on ‘Slate’ by Wilson Miner</string>
<key>name</key>
<string>Cowboy - Presentation</string>
/**
* How to:
* $('div.container').imagesLoaded(function(){console.log('all images loaded in .container');});
* In case you need to support IE8, you need to use HTML5shiv **and** need to modify jQuery the following way:
* https://github.com/jquery/jquery/commit/a9533893b9e5e9a248139f5794c5d6099382cf14
*/
(function($){
'use strict';
$.fn.imagesLoaded = (function(){
var imageLoaded = function (img, cb, delay){
@toranb
toranb / app-layout.component.js
Last active January 5, 2017 20:34
MasterDetailYieldedEach
import Ember from 'ember';
import hbs from 'htmlbars-inline-precompile';
export default Ember.Component.extend({
layout: hbs`
{{yield}}
`
});