Skip to content

Instantly share code, notes, and snippets.

View rondale-sc's full-sized avatar

Jonathan rondale-sc

  • Providence, Rhode Island
View GitHub Profile
@mikepack
mikepack / gist:7900448
Last active December 30, 2015 23:28
Removing Ember.run from all (Jasmine) tests

When testing Ember code, without putting expectations in a Ember.run callback, you'll get this error:

Failure/Error: Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run

The error recommends wrapping expectations in Ember.run:

describe 'something', ->
@pixelhandler
pixelhandler / transforms.js
Last active October 3, 2016 06:54
Raw object and array tranforms for Ember Data
/*
DS.attr('object')
*/
App.ObjectTransform = DS.Transform.extend({
deserialize: function(value) {
if (!$.isPlainObject(value)) {
return {};
} else {
return value;
}
@nusco
nusco / style.md
Last active April 8, 2017 23:13
Joseph William's Style Suggestions from Lesson 3

Diagnosis

Ignoring short introductory phrases ("In the meantime," "Although," etc.), underline the first seven or eight words in each sentence.

Look for three characteristics:

  1. Sentences that begin not with characters, but abstract nouns.
  2. Sentences that take more than six or seven words to get to a verb.
  3. Verbs that are less specific than the actions buried in the nouns around them.
@csfrancis
csfrancis / gdb_ruby_backtrace.py
Last active April 24, 2024 05:37
Dump an MRI call stack from gdb
# Updated for Ruby 2.3
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
@searls
searls / instructions.md
Created May 2, 2014 12:05
Creating a USB install disk of OS X Mavericks

Apple has changed how it distributes OS X Mavericks since its initial release in October 2013. This note was written on May 2, 2014. This affects the instructions you'll find online for how to make a bootable OS X installer.

It used to be that when you downloaded OS X from the App Store, the entire 5GB installer was placed in /Applications/Install OS X Mavericks.app. Now, there is a simple shortcut program placed in /Applications/OS X Mavericks.app. The app file is immediately removed in the event of an error or a successful post-install launch. When the download succeeds, the app file is launched which brings up the traditional install wizard, but this time mounted to /Volumes/Install OS X Mavericks.

I actually discovered this because if you already have a volume mounted of the same name (which I did, because I was trying to update my existing USB installer), the App Store download promptly fails right after finishing its download.

So if you have an empty disk you'd like to use as an installer that'

```
[miah@host ~]$ ps auxww|grep 'sshd: miah'
root 32416 0.0 0.1 82460 3952 ? Ss 16:35 0:00 sshd: miah [priv]
miah 32418 0.0 0.1 83136 2344 ? S 16:35 0:00 sshd: miah@pts/0
```
@shawndumas
shawndumas / findNodesBy.js
Created January 7, 2015 23:00
findNodesBy.js
/* globals module */
'using strict';
module.exports = function (options) {
if (arguments.length === 2) {
options = {
body: arguments[0],
match: arguments[1]
};
@jerel
jerel / clear.sh
Created April 13, 2015 19:13
Bash script to clear watchman roots to solve Error: watch EMFILE
watchman watch-list | tr -d '[:space:]' | grep -Po '(?<="roots":\[).*?(?=\])' | grep -Po '(?<=").*?(?="?,)' | while read path; do watchman watch-del "$path"; done
@ef4
ef4 / select.hbs
Last active October 7, 2021 09:41
Goodbye old Select View
<select onchange={{action (mut vehicle) value="target.value"}}>
{{#each vehicles key="@item" as |vehicleChoice|}}
<option value={{vehicleChoice}} selected={{eq vehicle vehicleChoice}}>{{vehicleChoice}}</option>
{{/each}}
</select>
export function initialize(/* container, application */) {
// IE9 doesn't define a console object until the development tools are opened.
// This causes hard-to-debug JavaScript errors for things like `console.log`.
window.console = window.console || {};
window.console.log = window.console.log || function () {};
window.console.info = window.console.info || function () {};
window.console.warn = window.console.warn || function () {};
window.console.error = window.console.error || function () {};
// We also ensure that if we call newer console functions it doesn't break
// older browsers.