Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan rondale-sc

  • Providence, Rhode Island
View GitHub Profile
@alexlafroscia
alexlafroscia / jsconfig.json
Created Aug 20, 2018
Ember App jsconfig.json
View jsconfig.json
{
"compilerOptions": {
"target": "es6",
"experimentalDecorators": true,
"baseUrl": ".",
"paths": {
"origin-story-core-ui/*": ["./app/*"]
}
},
"exclude": [
View initializers.ie9-console-fix.js
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.
@ef4
ef4 / select.hbs
Last active Oct 7, 2021
Goodbye old Select View
View select.hbs
<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>
@jerel
jerel / clear.sh
Created Apr 13, 2015
Bash script to clear watchman roots to solve Error: watch EMFILE
View clear.sh
watchman watch-list | tr -d '[:space:]' | grep -Po '(?<="roots":\[).*?(?=\])' | grep -Po '(?<=").*?(?="?,)' | while read path; do watchman watch-del "$path"; done
View findNodesBy.js
/* globals module */
'using strict';
module.exports = function (options) {
if (arguments.length === 2) {
options = {
body: arguments[0],
match: arguments[1]
};
View gist:147e97688a0e1c7b4897
```
[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
```
@searls
searls / instructions.md
Created May 2, 2014
Creating a USB install disk of OS X Mavericks
View instructions.md

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'

@csfrancis
csfrancis / gdb_ruby_backtrace.py
Last active Apr 23, 2022
Dump an MRI call stack from gdb
View gdb_ruby_backtrace.py
# 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()
@nusco
nusco / style.md
Last active Apr 8, 2017
Joseph William's Style Suggestions from Lesson 3
View style.md

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.
@pixelhandler
pixelhandler / transforms.js
Last active Oct 3, 2016
Raw object and array tranforms for Ember Data
View transforms.js
/*
DS.attr('object')
*/
App.ObjectTransform = DS.Transform.extend({
deserialize: function(value) {
if (!$.isPlainObject(value)) {
return {};
} else {
return value;
}