Skip to content

Instantly share code, notes, and snippets.

View iraniamir's full-sized avatar
💪
Let's Dance

Amir Irani iraniamir

💪
Let's Dance
  • Internet
View GitHub Profile
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@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.

@u1-liquid
u1-liquid / update-gitlab.sh
Created March 3, 2017 14:22
Update GitLab on Docker
#!/bin/sh
sudo docker stop gitlab
sudo docker rm gitlab
sudo docker pull gitlab/gitlab-ce:latest
sudo docker run --detach \
--hostname gitlab.some.where \
--publish 80:80 \
--publish 443:443 \
@BSN4
BSN4 / index.js
Last active December 1, 2017 16:44
rtl fix react-native-swiper
/**
* react-native-swiper
* @author leecade<leecade@163.com>
* RTL patch by Bader Almutairi <@phpfalcon>
*/
import React, { Component, PropTypes } from 'react'
import {
Text,
View,
ScrollView,
@shashankmehta
shashankmehta / setup.md
Last active January 7, 2024 11:57
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@chih
chih / showDoneButton.patch
Last active January 12, 2021 16:36
Adding showDoneButton property to react native's TextInput for number fields
diff --git a/node_modules/react-native/Libraries/Text/RCTTextField.h b/node_modules/react-native/Libraries/Text/RCTTextField.h
index c809f10..2d80af4 100644
--- a/node_modules/react-native/Libraries/Text/RCTTextField.h
+++ b/node_modules/react-native/Libraries/Text/RCTTextField.h
@@ -31,5 +31,6 @@
- (void)textFieldDidChange;
- (void)sendKeyValueForString:(NSString *)string;
- (BOOL)textFieldShouldEndEditing:(RCTTextField *)textField;
+- (void)handleDoneButtonFromInputAccessory;
@alirezaomidi
alirezaomidi / openconnect.sh
Last active November 28, 2023 12:04
Script to connect and disconnect to/from openconnect without pain
#!/bin/bash
# This script connects the computer to a vpn server using openconnect without pain
prog_name=$(basename $0)
# CHANGE YOUR_VPN_SERVER_DOMAIN to the VPN server you know like example.com
domain=YOUR_VPN_SERVER_DOMAIN
function help {
@alexsasharegan
alexsasharegan / .htaccess
Created September 7, 2016 00:36
Apache Config for React Router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
@dabit3
dabit3 / React Native Easings
Created August 1, 2016 03:38
React Native Easing animations
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
Easing,
Animated,
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"