Skip to content

Instantly share code, notes, and snippets.

View johnteee's full-sized avatar

John Lee johnteee

  • Taipei
View GitHub Profile
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@thetutlage
thetutlage / style.css
Last active April 23, 2021 03:19
Adonis websocket chat example style.css and html template
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700');
html, body {
height: 100%;
width: 100%;
}
body {
font-family: 'Open Sans', sans-serif;
font-weight: 400;
@MadratJerry
MadratJerry / find-rls-preview.sh
Last active February 21, 2024 16:56
Find the latest rust nightly version with rls-preview
#!/bin/bash
MAC=false
date -r "$now" +%Y-%m-%d &> /dev/null
if [ "$?" -ne "0" ]; then echo "LINUX"; MAC=false; else echo 'MAC'; MAC=true; fi
now=`date +%s`
while true
do
if [ "$MAC" == "true" ]; then data=`date -r "$now" +%Y-%m-%d`; else data=`date -d @"$now" +%Y-%m-%d`; fi
@will83
will83 / index.php
Last active November 1, 2022 10:21
PHP function to translate WGS84 to GPS coordinates
<?php
$lat = -24.108764;
$lng = 16.500156;
function WGS84toGPS($lat, $lng){
$lat = number_format($lat, 6);
$lng = number_format($lng, 6);
// define latitude coordinate with minutes and seconds
$lat_card = ($lat > 0) ? 'N' : 'S';
@goodjack
goodjack / log4php-for-laravel.php
Last active August 11, 2017 09:45 — forked from technoknol/log4php-for-laravel.php
Working log4php in Laravel (5.4)
<?php
// Middleware:
// app\Http\Middleware\Log4php.php
namespace App\Http\Middleware;
use Closure;
class Log4php
{
@julianfalcionelli
julianfalcionelli / RxErrorHandlingCallAdapterFactory.java
Last active June 21, 2022 08:55
Rx Error Handling for Retrofit2
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import io.reactivex.Completable;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.Single;
import io.reactivex.SingleSource;
import io.reactivex.annotations.NonNull;
@mburakerman
mburakerman / package.json
Last active September 26, 2022 17:32
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@i-am-tom
i-am-tom / bifunctor-profunctor.js
Created June 26, 2017 18:32
The main examples from the "Bifunctor + Profunctor" post.
const { Left, Right } = require('fantasy-eithers')
const daggy = require('daggy')
Function.prototype.map = function (f) {
return x => f(this(x))
}
//- Where everything changes...
const login = user =>
user.name == 'Tom'
@svaksha
svaksha / pythontojulia.md
Created May 12, 2017 12:27 — forked from cuckookernel/pythontojulia.md
Python to Julia Quick translation / conversion reference Guide

A quick and dirty syntax translation / conversion reference guide to ease the transition between Python and Julia. This is not meant as a reference to the language. For that you should read the manual.

Some important differences

  • Arrays in Julia are indexed starting from 1.
  • In Julia classes (i.e. types) don't own methods. Methods are implementations of generic functions and are invoked in a "static style", i.e. instead of Python's str1.rstrip(), we will have rstrip( str1 ), instead of file1.close(), close( file1 ).

Some important similarities.

@miguelfermin
miguelfermin / PageViewController.swift
Created May 8, 2017 10:05
Demonstrates how to add a UIPageViewController to a UIViewController
//
// ViewController.swift
// PageViewController
//
// Created by Miguel Fermin on 5/8/17.
// Copyright © 2017 MAF Software LLC. All rights reserved.
//
import UIKit