Skip to content

Instantly share code, notes, and snippets.

View okoala's full-sized avatar

仙森 okoala

View GitHub Profile
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://eggjs.github.io/*
// @resource eggcss https://eggjs.github.io/egg/css/index.css
// @grant GM_addStyle
// @grant GM_getResourceText
@okoala
okoala / index.ios.js
Created February 1, 2016 05:57 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@okoala
okoala / Ball Bounce
Created March 22, 2015 16:17
Canvas Study
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Canvas Application</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
</head>
<body>
<div>
<canvas id="canvasOne" width="500" height="500">
var React = require('react');
var EventListener = require('react/lib/EventListener');
var partition = require('linear-partitioning');
var TileLayout = React.createClass({
getDefaultProps: function() {
return {
gutter: 0,
photos: []
}
@okoala
okoala / block_ssh.sh
Created March 4, 2015 09:58
防止ssh暴力破解
#!/bin/bash
LIMIT=4
LOGFILE="/var/log/block_ssh.log"
TIME=$(date '+%b %_d %H') #example: Apr 11 11
echo $TIME
BLOCK_IP=$(grep "$TIME" /var/log/secure|grep Failed|awk '{print $(NF-3)}'|sort|uniq -c|awk '$1>"$LIMIT"{print $1":"$2}')
for i in $BLOCK_IP
do
IP=$(echo $i|awk -F: '{print $2}')
iptables-save|grep INPUT|grep DROP|grep $IP>/dev/null ? if [ $? -gt 0 ];then
@okoala
okoala / 0_reuse_code.js
Created June 14, 2014 07:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

JSConf Slides, Codes and Notes

These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.

Modular frontend with NPM - Jake Verbaten (@Raynos)

@okoala
okoala / novel.json
Last active October 1, 2016 22:26
小说下载
{
"不败战神": {
"url": "http://www.23us.com/html/27/27736/",
"bookmark": "第两百八十八节 唐天的判断"
},
"大主宰": {
"url": "http://www.23us.com/html/28/28373/",
"bookmark": "第一百九十五章 取巧"
},
"神级英雄": {
@okoala
okoala / digg.css
Last active December 23, 2015 19:09
我的Digg阅读器的Stylish样式配置。
::-webkit-scrollbar-corner {
background: rgba(0, 0, 0, 0);
}
::-webkit-scrollbar-track {
background-clip: padding-box;
border: solid rgba(0, 0, 0, 0);
border-width: 0 0 0 4px;
}
::-webkit-scrollbar-track:horizontal {
border-width: 4px 0 0