Skip to content

Instantly share code, notes, and snippets.

View AwesomeZaidi's full-sized avatar
:octocat:
Coding in JavaScript and Python (React and React Native 🔥)

Asim Zaidi AwesomeZaidi

:octocat:
Coding in JavaScript and Python (React and React Native 🔥)
View GitHub Profile
@AwesomeZaidi
AwesomeZaidi / accumulate.go
Created February 21, 2019 19:44
Accumulate - return arr of strings with all letters capitalized
package accumulate
import (
"strings"
)
// Accumulate returns all caps string
func Accumulate(s []string) []string {
// var newSlice []string
for pos, word := range s {
@AwesomeZaidi
AwesomeZaidi / acronym.go
Last active February 20, 2019 19:46
Golang Easy Acronym
package main
import (
"fmt"
)
// Abbreviate should have a comment documenting it.
func Abbreviate(s string) string {
var acronym string
// fmt.Println(acronym)
@AwesomeZaidi
AwesomeZaidi / redirect-simple.js
Created February 19, 2019 01:03
React one liner redirect
import React, { Component } from 'react';
class Home extends Component {
render() {
return (
<div>
<h1>Make School Club App</h1>
<button onClick={() => window.location.href = '/dashboard'}>Login</button>
</div>
);
@AwesomeZaidi
AwesomeZaidi / home.js
Created February 18, 2019 06:40
React Router Basic Redirect
import React, { Component } from 'react';
import { Route, Redirect } from 'react-router'
class Home extends Component {
constructor() {
super();
this.state = {
toLogin: false,
};
this.handleClick = this.handleClick.bind(this);
#!python3
def square_up(n):
"""Simple test cases in docstring
>>> square_up(2)
[0, 1, 2, 1]
>>> square_up(3)
[0, 0, 1, 0, 2, 1, 3, 2, 1]
>>> square_up(4)