Skip to content

Instantly share code, notes, and snippets.

View ilovejs's full-sized avatar
🐡

Hao ilovejs

🐡
  • 12:55 (UTC +10:00)
View GitHub Profile
@ilovejs
ilovejs / gist:56b8ef100f1c1572df88b067f61967ec
Created July 2, 2018 06:51 — forked from douglasjarquin/gist:2208690
Amazon RDS Performance Tuning Settings
rds-modify-db-parameter-group {param-group-name} \
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=query_cache_type, value=1, method=pending-reboot" \
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \
@ilovejs
ilovejs / isohybrid.pl
Created October 3, 2016 02:38 — forked from jsarenik/isohybrid.pl
isohybrid.pl from Syslinux-6.03
#!/usr/bin/perl
## -----------------------------------------------------------------------
##
## Copyright 2002-2008 H. Peter Anvin - All Rights Reserved
## Copyright 2009 Intel Corporation; author: H. Peter Anvin
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
## Boston MA 02111-1307, USA; either version 2 of the License, or
@ilovejs
ilovejs / progress-bar.sh
Created August 6, 2016 16:26 — forked from F1LT3R/progress-bar.sh
Bash Progress Bar
#!/bin/bash
# Bash Progress Bar: https://gist.github.com/F1LT3R/fa7f102b08a514f2c535
progressBarWidth=20
# Function to draw progress bar
progressBar () {
# Calculate number of fill/empty slots in the bar
@ilovejs
ilovejs / vowpal-hash.lhs
Created June 1, 2016 06:53 — forked from cartazio/vowpal-hash.lhs
vowpal hash
\begin{code}
{-# LANGUAGE BangPatterns #-}
{-|
Module : Data.Digest.VowpalHash
Copyright : (c) Carter Tazio Schonwald
License : BSD-style
Maintainer : first dot last @gmail.com
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@ilovejs
ilovejs / index.html
Last active August 29, 2015 14:19 — forked from ains/index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
# Fibonacci numbers WITH memoization.
# Initialize the memoization hash.
@scratchpad = {}
@max_fibo_size = 1_000_000_000_000
# Calculate the nth Fibonacci number, f(n).
def fibo (n)
val = if n <= 1
n
package main
import (
"flag"
"fmt"
"log"
"net/rpc"
"sync"
"time"
)
package org.rivendell.collections;
import java.lang.reflect.Array;
public class SkipListNode<T extends Comparable<? super T>> {
private final T value;
private final SkipListNode<T>[] next;
/**
* this is to provide index based access
<?
require("redis.php");
require("json.php");
$term = $_GET['term'];
$r = new Redis("127.0.0.1","6379");
$r->connect();
$items = $r->zrangebylex("kernel","[$term","[$term\xff",Array("LIMIT","0","10"));