This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Completeable named import": { | |
"prefix": ["nim"], | |
"body": ["import { ${2:value} } from \"${1:path}\";$0"], | |
"description": "A javascript named import statement that works with autocomplete by making you type the path statement first" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Given a glob pattern and a base directory expands that into a list of sass @import statements for files in that directory | |
glob = ARGV[0] | |
basedir = ARGV[0] | |
Dir.chdir(basedir) do | |
Dir[glob].each do |f| | |
puts "@import '#{f.gsub(/.scss$/, '')}';" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Christian Schlensker for Bugsnag. | |
// @flow | |
import { omit } from 'lodash'; | |
import * as React from 'react'; | |
// Creates a React context to track track the tree of ClickBoundaries down the component hierarchy. | |
const NodeContext = React.createContext(); | |
type Props = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ROOT_PATH = File.dirname(__FILE__) + '/js/dashboard/' | |
COMPONENT_REGEX = /window\.(\w+) =.+(React|Reflux)/ | |
files = Dir.glob(ROOT_PATH + "**/*.{js,jsx,coffee,cjsx}") | |
# hard coded modules that we want to require. This list will be amended by searching for | |
# `window.X = (React|Redux)` definitions in the code base | |
components = [ | |
{name: 'UserActions', import_path: 'user_actions'}, | |
{name: 'UrlService', import_path: 'services/url_service'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The bugsnag javascript libraries are not isomorphic so we need to specify which one we want to use depending on environment. | |
let Bugsnag; | |
if (process.env.IS_BROWSER) { | |
Bugsnag = require('bugsnag-js'); | |
Bugsnag.apiKey = process.env.MY_BROWSER_PROJECT_API_KEY; | |
} else { | |
Bugsnag = require('bugsnag-node'); | |
Bugsnag.register(process.env.MY_NODE_PROJECT_API_KEY); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp').config(['$httpProvider', function ($httpProvider) { | |
var interceptor = ['$q', function ($q) { | |
function success(response) { | |
return response; | |
} | |
function error(response) { | |
// Here we decide when and how to notify Bugsnag | |
if (response.status != 400) { // skip notification for form validation errors | |
Bugsnag.notify(response.statusText, response.config.url, {response: response}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clock Directive | |
// Demo at http://embed.plnkr.co/W36A8G1dJfmbnXSnbl98/preview | |
// Uses SVG to render an analog clock | |
// Requires moment.js and also moment-timezone if you set the `zone` optional attribute. | |
// Usage | |
// <clock radius='40'></clock> | |
// You can also set the timezone | |
// <clock radius='40' zone='America/New_York'></clock> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AnimalKingdom | |
def type | |
'Animal' | |
end | |
end | |
module PlantKingdom | |
def type | |
'Plant' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a plugin for ImpactJS that Google Chrome | |
// rendering for the Macbook Pro with Retina display. | |
// Based on the solution offered on http://www.html5rocks.com/en/tutorials/canvas/hidpi/ | |
// It probably have a negative impact on performance. | |
// Use wisely. | |
// | |
// | |
// Place this in lib/plugins/smart-resize.js | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KeyCodes = | |
K_CANCEL: 3 | |
K_HELP: 6 | |
K_BACK_SPACE: 8 | |
K_TAB: 9 | |
K_CLEAR: 12 | |
K_RETURN: 13 | |
K_ENTER: 14 | |
K_SHIFT: 16 | |
K_CONTROL: 17 |
NewerOlder