Skip to content

Instantly share code, notes, and snippets.

View aamnah's full-sized avatar
💭
the learning never stops

Aamnah aamnah

💭
the learning never stops
View GitHub Profile
@JaysonChiang
JaysonChiang / api.ts
Last active June 13, 2024 06:49
Example of Axios with TypeScript
import axios, { AxiosError, AxiosResponse } from 'axios';
import token from './somewhere';
interface Todo {
id: string;
title: string;
}
interface User {
id: string;
@derindutz
derindutz / use-persistent-swr.ts
Last active January 6, 2023 08:11
useSWR with localforage as a persistent cache
import useSWR from '@zeit/swr';
import localForage from 'localforage';
import { ConfigInterface } from '@zeit/swr/dist/src/types';
import { useState, useEffect } from 'react';
export function usePersistentSWR(key: string, fn?: Function, config?: ConfigInterface) {
let handleSuccess;
if (config !== undefined && config.onSuccess !== undefined) {
const { onSuccess } = config;
handleSuccess = (data: any, key: string, config: ConfigInterface) => {
@akamahesh
akamahesh / react-native-fonts.md
Created May 7, 2018 10:19 — forked from parshap/react-native-fonts.md
Fonts in React Native

Fonts in React Native

Default Fonts

A number of fonts are available by default based on the platform (e.g., Roboto on Android, Helvetica on iOS). See the full list here.

@Kmacpher
Kmacpher / videos.txt
Created May 6, 2017 16:32
Review videos for Admissions Prep
canPlayBanjo - https://www.youtube.com/watch?v=A4FD1XtiE1o&feature=youtu.be
maxOfThree - https://www.youtube.com/watch?v=J5mUUn75Mec&feature=youtu.be
Vowel Count - https://www.youtube.com/watch?v=7FE2gVN6WUc&feature=youtu.be
underToCamel - https://www.youtube.com/watch?v=6O5wkRsWirc&feature=youtu.be
11:05 - Palindrome - https://www.youtube.com/watch?v=dZINp1sMSaI
11:35 - First Repeating Letter - http://www.youtube.com/watch?v=EFPEmNi6ooY
12:05 - Utopian Tree - https://www.youtube.com/watch?v=PiGeQXKNiMo
12:35 - Nested Loops - http://www.youtube.com/watch?v=kLpE1cXZN8o
1:05- Rotate - http://www.youtube.com/watch?v=hcXxkDQ9qR4
@parshap
parshap / react-native-fonts.md
Last active April 20, 2023 13:27
Fonts in React Native

Fonts in React Native

Default Fonts

A number of fonts are available by default based on the platform (e.g., Roboto on Android, Helvetica on iOS). See the full list here.

@aamnah
aamnah / list-articles-by-collection.liquid
Last active January 9, 2022 00:44 — forked from nternetinspired/output-articles-by-collection.liquid
Loop through Jekyll collections and list their posts
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting titles.
{% endcomment %}
{% for collection in site.collections %}
{% assign name = collection.label %}
<h1>{{ name }}</h1>
@aamnah
aamnah / .htaccess
Last active May 30, 2018 16:19
.htaccess for WordPress
# Secure File Permissions
# https://codex.wordpress.org/Changing_File_Permissions#.htaccess_permissions
# 600 -rw------- /home/user/wp-config.php
# 604 -rw----r-- /home/user/cgi-bin/.htaccess
# 600 -rw------- /home/user/cgi-bin/php.ini
# 711 -rwx--x--x /home/user/cgi-bin/php.cgi
# 100 ---x------ /home/user/cgi-bin/php5.cgi
# BEGIN Increases Max Upload Size
php_value upload_max_filesize 64M
@budparr
budparr / hugo-multiple-where-statmenets.html
Last active June 4, 2024 19:16
multiple where statements Remember that Hugo uses parameters in the range statement from the inside out. Order matters.
{{ range first 3 (where (where .Site.Pages.ByDate.Reverse "Section" "posts") ".Title" "!=" .Title) }}
<!-- latest posts -->
{{ end }}
@aVolpe
aVolpe / EmbeddedGist.js
Created September 13, 2016 22:58
EmbeddedGist allows a gist to be embedded in a React application
import React, { Component } from 'react';
class EmbeddedGist extends Component {
constructor(props) {
super(props);
this.gist = props.gist;
this.file = props.file;
this.stylesheetAdded = false;
this.state = {