Skip to content

Instantly share code, notes, and snippets.

View Godofbrowser's full-sized avatar
🔥
Setting browsers on fire!!!

Emeke Ajeh Godofbrowser

🔥
Setting browsers on fire!!!
View GitHub Profile
@Godofbrowser
Godofbrowser / cgpa.html
Created July 7, 2016 11:20
Javascript cgpa calculator
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Demo CGPA calculator</title>
<meta name="generator" content="Bluefish 2.2.7" >
<meta name="author " content="Ajeh Emeke" >
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
@Godofbrowser
Godofbrowser / gist:7733c250771d14c9a987dd0a88155996
Created August 16, 2016 01:05 — forked from jrmadsen67/gist:bd0f9ad0ef1ed6bb594e
Laravel Quick Tip: Handling CsrfToken Expiration gracefully
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if
a form sits there for a while (like a login form, but any the same) the csrf token in the form will
expire & throw a strange error.
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner.
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T!
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function.
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the
@Godofbrowser
Godofbrowser / Entry.js
Created December 25, 2016 12:18 — forked from gilbert/Entry.js
Event Volunteers: Mithril.js Example from Tutorial Part 1 http://gilbert.ghost.io/mithril-js-tutorial-1/
//
// A model representing an Entry
//
window.Entry = {}
var store = []
var idCounter = 1
Entry.all = function () {
return store
@Godofbrowser
Godofbrowser / README.md
Created August 22, 2019 16:53 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@Godofbrowser
Godofbrowser / react-native-metro
Created September 18, 2019 08:10
Reconnect to network after device disconnect from react=native development server (metro)
Check that the device is reconnected to the machine with:
`adb devices`
Reroute the connection to the development server with:
`adb reverse tcp:8081 tcp:8081`
@Godofbrowser
Godofbrowser / a-short-ajax-error-story-1-of-4.js
Last active November 11, 2019 22:04
This gist is part of an article and may not covey the actual message on it's own. Link to article: https://medium.com/@ejjay/a-short-ajax-story-on-error-handlers-8baeeccbc062
import axios from 'axios';
import {notifier} from './util';
// Fetch some missing information
axios.get('/api/articles/not-found').then(resp => {
// So something with article information
}).catch(error => {
const statusCode = error.response ? error.response.status : null;
@Godofbrowser
Godofbrowser / a-short-ajax-error-story-2-of-4.js
Last active November 11, 2019 22:04
This gist is part of an article and may not covey the actual message on it's own. Link to article: https://medium.com/@ejjay/a-short-ajax-story-on-error-handlers-8baeeccbc062
import axios from 'axios';
import {notifier} from './util';
axios.interceptors.response.use(undefined, function (error) {
const statusCode = error.response ? error.response.status : null;
if (statusCode === 404) {
notifier.error('The requested resource does not exist or has been deleted')
}
@Godofbrowser
Godofbrowser / a-short-ajax-error-story-3-of-4.js
Last active November 11, 2019 22:04
This gist is part of an article and may not covey the actual message on it's own. Link to article: https://medium.com/@ejjay/a-short-ajax-story-on-error-handlers-8baeeccbc062
import axios from 'axios';
import {notifier} from './util';
// errorComposer will compose a handleGlobally function
const errorComposer = (error) => {
return () => {
const statusCode = error.response ? error.response.status : null;
if (statusCode === 404) {
notifier.error('The requested resource does not exist or has been deleted')
}
@Godofbrowser
Godofbrowser / a-short-ajax-error-story-4-of-4.ts
Last active November 11, 2019 22:04
This gist is part of an article and may not covey the actual message on it's own. Link to article: https://medium.com/@ejjay/a-short-ajax-story-on-error-handlers-8baeeccbc062
import axios, {AxiosError} from 'axios';
import {notifier} from './util';
interface ComposedError {
readonly message: string;
readonly error: AxiosError;
handleGlobally(): void;
getError(): AxiosError;
}
@Godofbrowser
Godofbrowser / cgpa.html
Created July 7, 2016 11:20
Javascript cgpa calculator
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Demo CGPA calculator</title>
<meta name="generator" content="Bluefish 2.2.7" >
<meta name="author " content="Ajeh Emeke" >
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">