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 / minifier.php
Created August 27, 2020 02:42
WordPress Minifier
<?php
/**
* W3C Fix and HTML minifier
* Nobody knows how this work, so don't touch it!!!
*
* https://wordpress.stackexchange.com/a/227896/129134
* https://stackoverflow.com/a/41148695
*/

Keybase proof

I hereby claim:

  • I am abrahamcalf on github.
  • I am abranhe (https://keybase.io/abranhe) on keybase.
  • I have a public key whose fingerprint is 9ADD AB32 9CC6 C591 677B 3A1D 9E1D 8BB2 6972 82A2

To claim this, I am signing this object:

@abranhe
abranhe / crown.edited.svg
Last active July 12, 2022 08:45
Colored Font Awesome Icon on READMEs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abranhe
abranhe / esm-package.md
Created November 5, 2021 05:03 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@abranhe
abranhe / reactstreaming.js
Created June 18, 2021 02:30 — forked from dabit3/reactstreaming.js
React Streaming code from live broadcast
import React from 'react';
import logo from './logo.svg';
import './App.css';
import ReactPlayer from 'react-player'
import { HashRouter, Link, Switch, Route } from 'react-router-dom'
import AuthComponent from './AuthComponent'
import { Auth, API } from 'aws-amplify'
import { createComment as CreateComment } from './graphql/mutations'
import { listComments as ListComments } from './graphql/queries'
import { onCreateComment as OnCreateComment } from './graphql/subscriptions'
@abranhe
abranhe / mysqlsync
Created March 4, 2021 16:36 — forked from samhernandez/mysqlsync
Sync remote mysql database to local over ssh
#!/bin/bash
# This script assumes you have ssh access to a remote server
# Both databases are backed up to sql files in the same directory
# this script is executed from.
# Usage:
# 1. Make sure this file is executable with `chmod +x mysqlsync`
# 2. Set the credentials for the variables at the top
# (Remember, no spaces around the '=' sign)
# 3. Run it from a directory where you'd like the backup files to go:
@abranhe
abranhe / lambda.aws.cloudformation.yml
Created February 21, 2021 11:28
Cloudformation Lamda Random Value
# Just adding support for a lambda
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
@abranhe
abranhe / handling_multiple_github_accounts.md
Created February 7, 2021 19:50 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@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 / font-weights.md
Created October 7, 2020 16:50 — forked from lukaszgrolik/font-weights.md
Commonly used names for CSS font-weight values

unknown source

value name
100 extralight/ultralight
200 light/thin
300 book/demi/light
400 regular/normal
500 medium
600 semibold/demibold