Skip to content

Instantly share code, notes, and snippets.

@alexeisavca
alexeisavca / ReactIgnore
Last active March 12, 2023 12:24
A simple component to make ReactJs ignore subtrees
var React = require('react/addons');
var ReactIgnore = {
displayName: 'ReactIgnore',
shouldComponentUpdate (){
return false;
},
render (){
return React.Children.only(this.props.children);
}
@enaqx
enaqx / gist:52f8da82e3d46bc2fc1f
Last active September 6, 2020 07:10
Topics for Front-end JavaScript interview preparing
Topics:
* Front-end: HTML/CSS/JavaScript
- http://www.w3schools.com/
- http://www.thatjsdude.com/
- https://github.com/darcyclarke/Front-end-Developer-Interview-Questions
- https://github.com/getify/You-Dont-Know-JS
- http://www.toptal.com/javascript/interview-questions
- http://superherojs.com/
- http://youmightnotneedjquery.com/
@anthonator
anthonator / client.js
Created November 11, 2014 15:41
Superagent wrapper with base URL support
var request = require("superagent");
/**
* Superagent wrapper for easily making AJAX requests. Provides a layer of
* convenience by adding a base URL to each request. The base URL is derived
* from the ```API_URL``` environment variable.
*/
module.exports = {
/**
* DELETE relative `path` with optional callback `fn(res)`.

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@addyosmani
addyosmani / README.md
Last active August 24, 2025 14:34 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@DjebbZ
DjebbZ / jshint-jsx-with-gulp-react-tools
Created September 12, 2014 07:41
Lint your React's JSX code with stock JSHint
/*
As JSX code is not lintable by JSHint, we simply transform
JSX to Javascript with react-tools then lint the resulting Javascript.
Bonus : as a JSX tag is just a Javascript function,
you get 1:1 match on line errors !
*/
var gulp = require("gulp"),
jshint = require("gulp-jshint"),
react = require("gulp-react");
@amineeg
amineeg / app.js
Created February 27, 2014 22:01
Get started angularJs, send data from angularJs to Php, decode json data in php, best practice
'use strict';
// Declare app level module which depends on filters, and services
var app= angular.module('myApp', ['ngRoute']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'loginCtrl'});
$routeProvider.otherwise({redirectTo: '/login'});
}]);
@callumacrae
callumacrae / build-tools.md
Last active October 25, 2023 15:14
Build tools written in JavaScript
@SirRawlins
SirRawlins / Rakefile
Last active September 15, 2020 06:22
Using Jekyll plugins on GitHub Pages.
# Rquire jekyll to compile the site.
require "jekyll"
# Github pages publishing.
namespace :blog do
#
# Because we are using 3rd party plugins for jekyll to manage the asset pipeline
# and suchlike we are unable to just branch the code, we have to process the site
# localy before pushing it to the branch to publish.
#
@insin
insin / contactform.js
Last active June 21, 2025 08:07
React contact form example
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({