Skip to content

Instantly share code, notes, and snippets.

View samccone's full-sized avatar
🐐

Sam Saccone samccone

🐐
  • Google
  • ∆∆∆<script>alert(prompt('why'))</script>
  • X @samccone
View GitHub Profile
> @ lint /Users/sam/Desktop/repos/todomvc/tooling
> jscs -c ../.jscsrc ../examples/webrx/
Illegal trailing whitespace at ../examples/webrx/Gruntfile.js :
12 | }
13 | };
14 |
---------^
15 | grunt.initConfig(conf);
```
> @ lint /Users/sam/Desktop/repos/todomvc/tooling
> jscs -c ../.jscsrc ../examples/webrx/
Expected indentation of 1 characters at ../examples/webrx/Gruntfile.js :
1 |module.exports = function (grunt) {
2 | "use strict";
---------^
3 |
4 | var conf = {
> @ lint /Users/sam/Desktop/repos/todomvc/tooling
> jscs -c ../.jscsrc ../examples/webrx/
Illegal trailing whitespace at ../examples/webrx/Gruntfile.js :
1 |module.exports = function (grunt) {
2 | 'use strict';
3 |
---------^
4 | var conf = {
@samccone
samccone / gist:8c2dcf659f3b0b21a7ad
Last active August 29, 2015 14:20
count-change
(defn count-change [amount denominations]
(cond
; when no more money we win
(= amount 0) 1
; coins left and no money left? we lose
(= (count denominations) 0) 0
; start with the largest and work down
:else (let [sorted-denominations (-> denominations sort reverse)
; get the largest
d (first sorted-denominations)]

Hey guys did another deep dive into an app's perf and I have some interesting dev-tools take aways...

Here are some things that were pretty darn hard to find. re: twosigma/beakerx#1546 (comment)

  1. when showing calls to methods that cause reflows or recalcs like ... get offsetWidth, it would be nice to highlight those methods calls in red or something, instead of showing the warning icon nested within it

  1. The other takeaway, or nice to have would be the ability to see a warning when you hit the max number of open network requests. Any kind of indicator in the network panel or debugger would be supppper nice
@samccone
samccone / gist:babb69f679b485743522
Created March 18, 2015 00:06
sauce connect basic test setup
beforeEach(function() {
if (process.env.SAUCE_USERNAME != undefined) {
this.browser = new webdriver.Builder()
.usingServer('http://'+ process.env.SAUCE_USERNAME+':'+process.env.SAUCE_ACCESS_KEY+'@ondemand.saucelabs.com:80/wd/hub')
.withCapabilities({
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
browserName: "chrome"
@samccone
samccone / gist:78c4d9b9e0903d4567d7
Created March 17, 2015 23:21
a simple travis setup to boot a python server
language: node_js
before_script:
- python -m SimpleHTTPServer &
- sleep 2
node_js:
- "0.12"
@samccone
samccone / gist:c916568e959ccf68acfa
Created March 17, 2015 23:11
simple selenium mocha test
var assert = require("assert");
var webdriver = require("selenium-webdriver");
describe("testing javascript in the browser", function() {
beforeEach(function() {
this.browser = new webdriver.Builder()
.withCapabilities({
browserName: "chrome"
}).build();
@samccone
samccone / gist:caf551221b58052bb57c
Created March 17, 2015 22:33
basic travis node setup
language: node_js
node_js:
- "0.12
<html>
<head>
</head>
<body>
<div id="app"></div>
</body>
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/lodash/index.js"></script>
<script src="node_modules/backbone/backbone.js"></script>
<script src="node_modules/backbone.marionette/lib/backbone.marionette.js"></script>