Skip to content

Instantly share code, notes, and snippets.

View iAmShakil's full-sized avatar
🎯
Focusing

Shakil Ahmed iAmShakil

🎯
Focusing
View GitHub Profile
@munky69rock
munky69rock / check-url-scheme.js
Created January 18, 2013 07:02
iPhone Safari: check if URL scheme is supported in javascript
// cf: http://stackoverflow.com/questions/627916/iphone-safari-check-if-url-scheme-is-supported-in-javascript
function checkUrlScheme(app_url_scheme, app_install_url, app_name) {
document.location = app_url_scheme;
setTimeout(function() {
if(confirm('You do not seem to have '+app_name+' installed, do you want to go download it now?')){
document.location = app_install_url;
}
}, 300);
}
@Maluen
Maluen / react-navigation-drawer-stack.js
Created September 5, 2018 09:57
React Navigation: combining drawer and stack navigator
const StackNavigator = createStackNavigator({
Home: HomeScreen,
Search: SearchScreen,
Details: DetailsScreen,
Credits: CreditsScreen,
}, {
navigationOptions: {
header: null,
},
});
@learncodeacademy
learncodeacademy / flightplan-html.md
Last active February 26, 2021 22:07
Deploy HTML site with Flightplan

###Prerequesites

Install flightplan globally

npm install -g flightplan

Install flightplan in your project folder

/**
* Bear Theme with Typora
*
* @version : 0.0.1
* @update : 2018/09/08
* @homepage: https://gist.github.com/Kenshin/e5adc79da3149315bdfd72a35b70d65e
* @license : MIT https://github.com/kenshin/mduikit/blob/master/LICENSE
* @author : Kenshin Wang <kenshin@ksria.com>
*
* @copyright 2018
@nhagen
nhagen / PromisAllWithFails.js
Last active November 15, 2022 18:11
Wait until all promises have completed even when some reject, with Promise.all
var a = ["sdfdf", "http://oooooolol"],
handleNetErr = function(e) { return e };
Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr))
.then(function(sdf, invalid) {
console.log(sdf, invalid) // [Response, TypeError]
})
.catch(function(err) {
console.log(err);
})
@sdiama
sdiama / webview.js
Created May 29, 2019 17:47
React Native: Handle hardware back button @ webview
import React, { Component } from 'react';
import { WebView, BackHandler } from 'react-native';
export default class WebViewMoviezSpace extends Component {
constructor(props) {
super(props);
this.WEBVIEW_REF = React.createRef();
}
componentDidMount() {
@kanzitelli
kanzitelli / React-Native-WebView-Cookies.js
Last active June 27, 2023 08:30
React Native Trick: Get Cookies of WebView without using any native modules such as react-native-cookies. Might be helpful for getting JWT while making OAuth2 👽
// @flow
import React, { Component } from 'react';
import {
WebView,
} from 'react-native';
class LoginScreen extends Component {
state = {
cookies : {},
@jirutka
jirutka / -README.md
Last active October 31, 2023 09:07
How to use terminal on Windows and don’t go crazy…

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings
@molcik
molcik / free-photoshop.md
Created May 18, 2018 08:39
Modify Photoshop to never ending trial

How Does It Work

All you have to do, to extend your trial period, is change number in TrialKey element in application.xml. This file is located in /Library/Application Support/Adobe/Adobe Photoshop/AMT. You can navigate there with this command:

cd /Library/Application\ Support/Adobe/Adobe\ Photoshop\ */AMT

Then you have to open the file and edit it. You can use just TextEdit app.

open -a TextEdit application.xml
# 10_basic.py
# 15_make_soup.py
# 20_search.py
# 25_navigation.py
# 30_edit.py
# 40_encoding.py
# 50_parse_only_part.py