Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Ha ha404

View GitHub Profile
@ha404
ha404 / no-bind.js
Created Feb 7, 2017
exploring alternatives to .bind
View no-bind.js
class FooBar {
// EXAMPLE 1
handleClick = (event) => {
console.log(event.target.dataset.id)
}
// EXAMPLE 2
// handleClick = (data) => () => {
// console.log(data)
View snippets.cson
# 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:
#
@ha404
ha404 / styles.less
Last active May 12, 2017
Atom Stylesheet
View styles.less
/*
* 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
*/
View Sauron.js
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 Nov 6, 2015
convert video files
View ffmpeg.md

#Convert .mov to .mp4 with ffmpeg

brew install ffmpeg \
  ffmpeg -i input.mov -vcodec copy -acodec copy output.mp4
@ha404
ha404 / airbnb.md
Last active Jan 18, 2018
Airbnb JavaScript Style Guide() {
View airbnb.md

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:
{
View robot.js
//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
Arrow after speech bubbles
View after-arrow.css
.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;
}
You can’t perform that action at this time.