Skip to content

Instantly share code, notes, and snippets.

View oksep's full-sized avatar
🎯
Cogito, ergo sum

Septenary oksep

🎯
Cogito, ergo sum
View GitHub Profile
@oksep
oksep / rxjs_operators_by_example.md
Created March 31, 2018 16:10 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@oksep
oksep / root_config.yaml
Created March 22, 2018 11:29
hexo config
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: Hexo
subtitle:
description:
author: John Doe
language: zh-CN
@oksep
oksep / readme.md
Last active November 28, 2016 10:42
WebStorm add file templates

Follow

  1. open settings & click File and Code Templates
  2. add a new one template, named JSX View Template
  3. copy template.js into the textarea & click apply
  4. new File & select JSX View Template
@oksep
oksep / shake-shake.js
Last active November 18, 2016 09:26
shake-shake javascript
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
@oksep
oksep / better-nodejs-require-paths.md
Created September 23, 2016 03:36 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@oksep
oksep / FadeableNavBar.js
Created August 22, 2016 09:00
react-native-FadeableNavBar
// @flow
'use strict'
import React, {PropTypes, Component} from 'react';
import {View, Image, TouchableOpacity, StyleSheet, Text, Dimensions} from 'react-native';
import NavBar from 'react-native-navbar'
var {height, width} = Dimensions.get('window')
const propTypes = {
@oksep
oksep / UIView+.swift
Created June 20, 2016 10:19
iOS UIView custom interaction
extension UIView {
func addOnClickListener(target: AnyObject, action: Selector) {
let gr = UITapGestureRecognizer(target: target, action: action)
gr.numberOfTapsRequired = 1
userInteractionEnabled = true
addGestureRecognizer(gr)
}
}
@oksep
oksep / UINavigationBar+.swift
Last active June 15, 2016 11:45
UINavigationBar transparency by ScrollView
/**
* 可渐变的 UINavigationBar
* 从 objective-c 版本 https://github.com/ltebean/LTNavigationBar 翻译而来
*/
extension UINavigationBar {
@nonobjc static var overlay:UIView?
// 设置 overlay 背景色
func lt_setBackgroundColor(backgroundColor: UIColor) {
@oksep
oksep / mount read-only-filesystem.md
Created May 20, 2016 10:06
read-only-filesystem

Open terminal

adb shell

su

  • Mount system RW: mount -o rw,remount,rw /system
@oksep
oksep / CustomToast
Last active June 15, 2016 11:45
CustomToast.java
import android.content.Context;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup.LayoutParams;