Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ha404
ha404 / airbnb.md
Last active January 18, 2018 08:17
Airbnb JavaScript Style Guide() {

Quick start guide to using Airbnb's style with ESLint.

  1. Navigate to your project directory and run this:
npx install-peerdeps --dev eslint-config-airbnb
  1. Save an .eslintrc file in your project directory:
{
@ha404
ha404 / styles.less
Last active May 12, 2017 18:01
Atom Stylesheet
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@ha404
ha404 / no-bind.js
Created February 7, 2017 23:38
exploring alternatives to .bind
class FooBar {
// EXAMPLE 1
handleClick = (event) => {
console.log(event.target.dataset.id)
}
// EXAMPLE 2
// handleClick = (data) => () => {
// console.log(data)
@ha404
ha404 / snippets.cson
Created November 29, 2016 20:16
Atom Snippets
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import _ from 'lodash';
import { connectToStores } from 'fluxible-addons-react';
import ApplicationStore from '../../stores/ApplicationStore';
import windowSizeChange from '../../actions/windowSizeChange';
import windowScrollChange from '../../actions/windowScrollChange';
@ha404
ha404 / ffmpeg.md
Last active November 6, 2015 20:01
convert video files

#Convert .mov to .mp4 with ffmpeg

brew install ffmpeg \
  ffmpeg -i input.mov -vcodec copy -acodec copy output.mp4
@ha404
ha404 / robot.js
Created December 3, 2012 19:38
Hawsome
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@ha404
ha404 / after-arrow.css
Created May 10, 2012 15:30
Arrow after speech bubbles
.element::after {
content: "";
position: absolute; // make the <element> positioned relative
top: 0; // position this where you want the bubble
left: 0;
border: 15px solid transparent;
border-bottom-color: red;
display: block;
width: 0;
}