Skip to content

Instantly share code, notes, and snippets.

View Mosoc's full-sized avatar
🌐
Globalization, Internationalization and localization

Bruno Antinomio Mosoc

🌐
Globalization, Internationalization and localization
View GitHub Profile
@Mosoc
Mosoc / NSObject.swift
Created January 6, 2017 02:20 — forked from mosluce/NSObject.swift
超惰性 extension 大全 + 默司微調
//
// NSObject.swift
// QBDemo01
//
// Created by 默司 on 2016/12/2.
// Copyright © 2016年 默司. All rights reserved.
//
import Foundation
@Mosoc
Mosoc / what-forces-layout.md
Created February 15, 2017 03:07 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@Mosoc
Mosoc / Spread Operator.md
Created February 15, 2017 08:03 — forked from Rplus/Spread Operator.md
6 Great Uses of the Spread Operator, via: https://davidwalsh.name/spread-operator

Calling Functions without Apply

function doStuff (x, y, z) { }
var args = [0, 1, 2];
doStuff(...args);
function doStuff(x, y, z) {}
var args = [0, 1, 2];
@Mosoc
Mosoc / upgrade.md
Created March 22, 2017 15:42 — forked from chrismccord/upgrade.md
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@Mosoc
Mosoc / jsnote.js
Created September 25, 2017 01:27 — forked from mason276752/jsnote.js
你平常不會用到的js
str1 = "http://www.google.tw/search?q=中文";
obj = {
get a(){return '1';},
set b(value){this.c = value;},
c:1
};
class Cls{
constructor(name){
console.log("hello",name);
if (typeof(new.target)==='function')
@Mosoc
Mosoc / readme.md
Created November 12, 2017 03:38 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@Mosoc
Mosoc / codility_solutions.txt
Created January 25, 2018 09:34 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
Lesson 1 - Iterations
- BinaryGap - https://codility.com/demo/results/trainingU2FQPQ-7Y4/
Lesson 2 - Arrays
- OddOccurrencesInArray - https://codility.com/demo/results/trainingFN5RVT-XQ4/
- CyclicRotation - https://codility.com/demo/results/trainingSH2W5R-RP5/
Lesson 3 - Time Complexity
- FrogJmp - https://codility.com/demo/results/training6KKWUD-BXJ/
- PermMissingElem - https://codility.com/demo/results/training58W4YJ-VHA/
@Mosoc
Mosoc / brainfuck.ts
Created May 4, 2019 14:37 — forked from meenie/brainfuck.ts
A Brainfuck interpreter written in TypeScript
class Brainfuck {
ptr: number = 0
cmdPtr: number = 0
data: number[] = [0]
output: any[] = []
loops: number[] = []
input: string;
arg: string;
argPtr: number = 0;
@Mosoc
Mosoc / ThisLikeRef.js
Created October 28, 2019 14:32 — forked from dwighthouse/ThisLikeRef.js
Using This-Like Ref Structure to Solve Hook State Updating and Function Reference Problems
import React, { memo, useCallback } from 'react';
import ChildComponent from './wherever/ChildComponent.js';
const updateChild = (props, childId, changes) => {
props.onUpdate({
type: 'childChanged',
childId: childId,
changes: changes,
});
};