Skip to content

Instantly share code, notes, and snippets.

View lcfd's full-sized avatar
🦙

Luca Fedrizzi lcfd

🦙
View GitHub Profile
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
@lcfd
lcfd / angular.html
Last active March 16, 2016 14:02
Bootstrap v4 - Angular 1.5.0 boilerplate
<!doctype html>
<html ng-app="*">
<head>
<title>Title</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
<link rel="stylesheet" href="site.css" type="text/css">
</head>
<body ng-controller="*">
@lcfd
lcfd / gist:da2e108faf9022cb56be4c157e042e67
Created April 27, 2016 13:41 — forked from neilcarpenter/gist:8979ea9ed91b10e36af9
Enable Emmet in .JSX files, using Babel JSX Syntax highlighter
// add to Preferences > Key Bindings - User
// see http://stackoverflow.com/a/26619524 for context
{ "keys": ["tab"], "command": "expand_abbreviation_by_tab",
"context": [
{
"operand": "source.js",
"operator": "equal",
"match_all": true,
"key": "selector"
@lcfd
lcfd / installwp.sh
Created June 16, 2016 09:04
Install latest wordpress with bash
#!/bin/bash
wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
mv wordpress/* ./
rmdir ./wordpress/
rm -f latest.tar.gz
@lcfd
lcfd / Python3 Virtualenv Setup
Created July 20, 2016 06:49 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3 Virtualenv
To install virtualenv via pip
$ pip3 install virtualenv
Note that virtualenv installs to the python3 directory. For me it's:
$ /usr/local/share/python3/virtualenv
Create a virtualenvs directory to store all virtual environments
$ mkdir somewhere/virtualenvs
Make a new virtual environment with no packages
@lcfd
lcfd / flux.js
Created September 21, 2016 06:54 — forked from acdlite/flux.js
A Redux-like Flux implementation in <75 lines of code
/**
* Basic proof of concept.
* - Hot reloadable
* - Stateless stores
* - Stores and action creators interoperable with Redux.
*/
import React, { Component } from 'react';
export default function dispatch(store, atom, action) {
@lcfd
lcfd / .babelrc
Last active November 15, 2016 10:02 — forked from albertfdp/webpack.config.js
All kinds of webpack configs. [ normal, react + .babelrc ]
{
"presets": ["react", "es2015", "stage-0"]
}
@lcfd
lcfd / ReduxMicroBoilerplate.js
Created December 2, 2016 13:31 — forked from gaearon/ReduxMicroBoilerplate.js
Super minimal React + Redux app
import React, { Component } from 'react';
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux';
import { provide, connect } from 'react-redux';
import thunk from 'redux-thunk';
const AVAILABLE_SUBREDDITS = ['apple', 'pics'];
// ------------
// reducers
// ------------
@lcfd
lcfd / Promise.js
Created February 8, 2017 15:51
Es6 and Promise example
var pr1 = new Promise((resolve, reject) => {
setTimeout(function () {
resolve([1,3,4,46,234,33,4,536]);
}, 500);
})
var pr2 = new Promise((resolve, reject) => {
setTimeout(function () {
resolve(20);
}, 1000);
@lcfd
lcfd / prototypes.js
Last active March 3, 2017 15:36
A collection of useful prototypes that I use.
/**
* First letter of a string converted into uppercase
*/
String.prototype.capitalizeFirstLetter = function () {
return this
.charAt(0)
.toUpperCase() + this.slice(1);
}
/**