Skip to content

Instantly share code, notes, and snippets.

View johnny4young's full-sized avatar
:octocat:
Coding

Johnny IV Young Ospino johnny4young

:octocat:
Coding
View GitHub Profile
@johnny4young
johnny4young / compilenode.sh
Created July 19, 2021 02:49
compile nodejs
#!/bin/env bash
rm -fr node*
wget https://github.com/nodejs/node/archive/refs/tags/v14.17.3.tar.gz
tar xf v14.17.3.tar.gz
cd node-14.17.3
./configure
start_time="$(date -u +%s)"
make -s -j 8 2>&1
end_time="$(date -u +%s)"
version: '2.1'
services:
php:
tty: true
build:
context: .
dockerfile: tests/Docker/Dockerfile-PHP
args:
version: cli
volumes:
url project: https://github.com/johnny4young/ionic-test-company-app
1. clone this repo: `git clone https://github.com/johnny4young/ionic-test-company-app.git`
2. `cd ionic-test-company-app`
3. `npm install`
4. run `ionic serve` from a terminal
Important files:
@johnny4young
johnny4young / launch.json
Created February 19, 2017 19:37 — forked from auchenberg/launch.json
VSCode + React debug config
{
"version": "0.2.0",
"configurations": [
{
"name": "Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}/src",
"userDataDir": "${workspaceRoot}/.chrome",
@johnny4young
johnny4young / sync-vs-async-recursion.js
Created September 28, 2016 16:32 — forked from mikermcneil/sync-vs-async-recursion.js
Two examples demonstrating how to implement recursion using synchronous and/or asynchronous calls in Sails.js/Node.js.
// I frequently advise against defining inline functions.
// There are, of course, two obvious exceptions:
// 1. The "I'm done" callback(s) that you pass in to `.exec()`, or as the last argmt to any asynchronous library method in Node core.
// 2. The iteratee callbacks that you pass in to functions like `_.each()`, `_.reduce()`, and `async.each()`
//
// But there are still a few cases where definining inline functions can feel very necessary.
// One of those is recursion.
//
// I made this gist to demonstrate how you can implement recursion using synchronous and/or asynchronous calls.
// We'll go through two examples, starting with synchronous recursion over a virtual filesystem that lives in-memory
@johnny4young
johnny4young / unhandled-exceptions.js
Created September 5, 2016 17:21 — forked from ericelliott/unhandled-exceptions.js
Capturing Unhandled Exceptions
window.onerror = function(message, file, line, column, error) {
error = error || {};
$.ajax({
method: 'POST',
url: 'https://yourapp.com/path/to/error/log',
data: JSON.stringify({
message: message,
file: file,
line: line,
column: column,
@johnny4young
johnny4young / styles.less
Created May 17, 2016 17:12 — forked from brandondurham/styles.less
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Angular JS</title>
</head>
<body ng-app="jsbin">
<div ng-controller="DemoCtrl as demo">
<h1>Hello {{demo.name}}</h1>
<input type="text" value="{{demo.name | toHtmlEntities }}"></input>
// Create Base64 Object
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r
@johnny4young
johnny4young / console.js
Last active August 29, 2015 14:18 — forked from jmhdez/console.js
(function(window, document) {
// Create the DOM structure to hold the console messages
var div = document.createElement("div");
div.style.cssText = "position: absolute; " +
"top: 5px; left: 5px; right: 5px; bottom: 5px; " +
"padding: 10px; " +
"overflow-y: auto; " +
"display: none; " +