Skip to content

Instantly share code, notes, and snippets.

View abranhe's full-sized avatar
🐂
Coding Furiously

Abraham abranhe

🐂
Coding Furiously
View GitHub Profile
@abranhe
abranhe / ParallexView.js
Created May 11, 2020 04:34
Parallex View React Native
import React, { Component } from 'react';
import {
Animated,
Platform,
StyleSheet,
Text,
View,
RefreshControl,
} from 'react-native';
@abranhe
abranhe / JSON.js
Created February 21, 2020 21:11 — forked from cloudxero/gist:2369301
IE5, IE7, IE8 Polyfill for JSON.parse
(function(a,b){typeof define=="function"&&define.amd?define("json",["exports"],b):b(typeof exports=="object"&&exports||this.JSON||(this.JSON={}))})(this,function(a){var b={}.toString,c={}.hasOwnProperty,d,e,f;return e=typeof a.stringify=="function",f=typeof a.parse=="function",function(){var c='{"result":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}',d,g,h;if(e){d=function(){return 1},d.toJSON=d;try{switch(!1){case a.stringify(0)==="0":case a.stringify(new 0..constructor)==="0":case a.stringify(new"".constructor)=='""':case a.stringify(b)===void 0:case a.stringify(void 0)===void 0:case a.stringify()===void 0:case a.stringify(d)==="1":case a.stringify([d])=="[1]":case a.stringify([void 0])=="[null]":case a.stringify(null)=="null":case a.stringify([void 0,b,null])=="[null,null,null]":case a.stringify({result:[d,true,false,null,"\0\b\n\f\r "]})==c:case a.stringify(null,d)==="1":case a.stringify([1,2],null,1)=="[\n 1,\n 2\n]":case(d=new Date(-864e13)).getUTCFullYear()!=-271821||a.stringify(d)=='"-271821-04-20T00:
@abranhe
abranhe / dedent-template.js
Last active January 3, 2020 10:21 — forked from zenparsing/dedent-template.js
Dedenting Template Strings's Fork
function dedent(callSite, ...args) {
function format(str) {
let size = -1;
return str.replace(/\n(\s+)/g, (m, m1) => {
if (size < 0)
size = m1.replace(/\t/g, " ").length;
@abranhe
abranhe / readme.md
Created April 30, 2019 05:49
Install Git on Mac
#!/bin/bash
# ______ ______
# / \ / \
# /$$$$$$ |/$$$$$$ |
# $$ | $$ |$$ \__$$/
# $$ | $$ |$$ \
# $$ | $$ | $$$$$$ |
# $$ \__$$ |/ \__$$ |
# $$ $$/ $$ $$/
# $$$$$$/ $$$$$$/ https://p.abranhe.com/os
@abranhe
abranhe / readme.md
Last active May 14, 2020 06:01
Java Executables

Convert Java Executable to Linux Executable

Introduction

Java program is universal and applicable to most operating systems, but if someone intends to create a native executable binary file for certain operation system, is that possible?

The answer is yes. Here is the instruction to create an executable program for Linux with .run as its extension name.

Create a text file use your favorite text editor (In this case it is gedit) and type these code below:

@abranhe
abranhe / SyntaxHighlighter.js
Created February 2, 2019 17:43
React Native Syntax Highlighter
import React, { Component } from 'react';
import { StyleSheet, Text, View, TextInput } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import SyntaxHighlighter from 'react-native-syntax-highlighter'; // 2.0.0
import { tomorrow } from 'react-syntax-highlighter/styles/prism' // 7.0.1
const code = `const example = require('example');
console.log('Some example ' + example());
`;
@abranhe
abranhe / readme.md
Created January 26, 2019 07:30
How to delete all docker containers and Images
@abranhe
abranhe / readme.md
Last active January 26, 2019 07:04
Running GUI applications using Docker for Mac

Running GUI applications using Docker for Mac

This is a short guide explaining how to run GUI applications from within Docker on Mac. This uses XQuartz to enable to set the DISPLAY variable within the container.

Install XQuartz

You can install XQuartz using homebrew with brew cask install xquartz or directly from the website here. At the time of writing, I had 2.7.11 installed on my machine with OSX El Capitan. After installing XQuartz restart your machine.

Install Docker for Mac

@abranhe
abranhe / AlertExample.js
Created December 28, 2018 20:41
React Native Alert
import React from 'react'
import { Alert, Text, TouchableOpacity, StyleSheet } from 'react-native'
const AlertExample = () => {
const showAlert = () =>{
Alert.alert(
'You need to...'
)
}
return (