Skip to content

Instantly share code, notes, and snippets.

View ConAntonakos's full-sized avatar
🏠
Working from home

Constantine Antonakos ConAntonakos

🏠
Working from home
View GitHub Profile
@jnrbsn
jnrbsn / gist:8062545
Created December 20, 2013 22:18
Install Python 2.7, easy_install, and pip on Amazon Linux
sudo yum update
sudo yum install python27
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | sudo /usr/bin/python27
sudo easy_install pip
echo "alias python='python27'" >> ~/.bashrc
source ~/.bashrc
@sokra
sokra / webpack.js
Last active February 11, 2024 22:54
// webpack is a module bundler
// This means webpack takes modules with dependencies
// and emits static assets representing those modules.
// dependencies can be written in CommonJs
var commonjs = require("./commonjs");
// or in AMD
define(["amd-module", "../file"], function(amdModule, file) {
// while previous constructs are sync
// this is async
@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@arnaudbreton
arnaudbreton / async-process-jasmine.Spec.js
Last active August 29, 2015 14:00
The 5 best front-end developer tools blogpost: testing with Mocha and Jasmine
AsyncProcess = require('./async-process').AsyncProcess
describe('AsyncProcess', function() {
var asyncProcess;
beforeEach(function() {
asyncProcess = new AsyncProcess();
});
it('should process 42', function() {
@addyosmani
addyosmani / array.prototype.fill.js
Last active May 31, 2016 19:16
ES6 Array.prototype.fill() polyfill
if ( ![].fill) {
Array.prototype.fill = function( value ) {
var O = Object( this );
var len = parseInt( O.length, 10 );
var start = arguments[1];
var relativeStart = parseInt( start, 10 ) || 0;
var k = relativeStart < 0
? Math.max( len + relativeStart, 0)
: Math.min( relativeStart, len );
@patrickhammond
patrickhammond / android_instructions.md
Last active March 29, 2024 20:14
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@ChaseWest
ChaseWest / react-table-component.js
Created May 24, 2014 07:25
React Table Component for creating a very basic html table
var Table = React.createClass({
render: function render() {
var _self = this;
var thead = React.DOM.thead({},
React.DOM.tr({},
this.props.cols.map(function (col) {
return React.DOM.th({}, col);
})));
#!/usr/bin/env node
var program = require('commander');
var request = require('request');
var chalk = require('chalk');
program
.version('0.0.1')
.usage('[options] <keywords>')
.option('-o, --owner [name]', 'Filter by the repositories owner')
@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@ToddSmithSalter
ToddSmithSalter / gulpfile.js
Created June 18, 2014 23:27
Base gulpfile.js as of June 18, 2014
'use strict';
var
chalk = require('chalk'),
gulp = require('gulp'),
clean = require('gulp-clean'),
concat = require('gulp-concat'),
deporder = require('gulp-deporder'),
gulpif = require('gulp-if'),