Skip to content

Instantly share code, notes, and snippets.

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

Waleed Ahmad waleedahmad

🏠
Working from home
View GitHub Profile
<?php
function generateRandomString($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
@waleedahmad
waleedahmad / App.js
Last active November 24, 2020 23:52
Re-render Navbar component when children component is replaced on redirect
var App = React.createClass({
getInitialState(){
return {
auth : false
}
},
checkAuth(){
var self = this;
@waleedahmad
waleedahmad / react_es6_webpack.config.js
Created March 4, 2016 17:29
Webpack config file for React and ES6
var webpack = require('webpack');
module.exports = {
context: __dirname + "/src",
entry: "./app.js",
output: {
filename: "app.js",
path: __dirname + "/build",
},