Skip to content

Instantly share code, notes, and snippets.

@cezarderevlean
cezarderevlean / index_hmr.jsx
Created October 25, 2017 08:03
HMR index example
import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import App from './app/App.jsx';
import './styles/main.scss';
const render = Component => {
ReactDOM.render(
<AppContainer>
<Component />
@cezarderevlean
cezarderevlean / webpack_example.config.js
Created October 25, 2017 07:35
Webpack config example
const rootUrl = '/';
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const WebpackNotifier = require('webpack-notifier');
const extractStyle = new ExtractTextPlugin({
@cezarderevlean
cezarderevlean / .babelrc
Last active June 16, 2017 00:04
React.js env
{
"presets":[
[
"es2015",
{
"modules": false
}
],
"react"
],
@cezarderevlean
cezarderevlean / folder-img-to-html.php
Created November 29, 2016 14:31
show all images in a folder into a html page
<?php
$dir = 'img';
$files = scandir($dir);
$ext = '.png';
foreach ($files as $img) {
if ( substr_compare($img, $ext, -strlen($ext), strlen($ext)) === 0 ) {
?>
<h2 style="font-family: monospace;"><?=$img?></h2>
<div style="text-align: center; margin-bottom: 100px;">
<img src="img/<?=$img?>">
@cezarderevlean
cezarderevlean / git-assume.txt
Last active June 15, 2017 10:47
Git assume
http://i.imgur.com/pQXZjor.png
~/.gitconfig
[alias]
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
assume = "update-index --assume-unchanged"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
#titanic {
float: none;
}
#big-bang::before {
content: "";
}
#tower-of-pisa {
font-style: italic;
}
.ninja {
<?php
$files = array();
$dir = opendir('.'); // open the cwd..also do an err check.
while(false != ($file = readdir($dir))) {
if(($file != ".") and ($file != "..") and ($file != "index.php")) {
$files[] = $file; // put in array.
}
}