Skip to content

Instantly share code, notes, and snippets.

View ilovejs's full-sized avatar
🐡
mememe, hv a good fish !

Michael Zhuang ilovejs

🐡
mememe, hv a good fish !
  • Sydney
  • 18:42 (UTC +10:00)
View GitHub Profile
@ilovejs
ilovejs / absolute.html
Created August 21, 2013 00:26
# parent contains 3 child div, test absolute layout # Notice the comment
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>GETTING STARTED WITH BRACKETS</title>
<meta name="description" content="An interactive getting started guide for Brackets.">
<link rel="stylesheet" href="main.css">
</head>
<style>
@ilovejs
ilovejs / All-Relative-Some-float-Clearfix.html
Created August 21, 2013 00:42
child elements are floating to left, having clearfix div at last.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>GETTING STARTED WITH BRACKETS</title>
<meta name="description" content="An interactive getting started guide for Brackets.">
<link rel="stylesheet" href="main.css">
</head>
<style>
@ilovejs
ilovejs / responsive.less
Created August 26, 2013 01:36
backup responsive design - media query is not good
@import 'grid.less';
// Specify the number of columns and set column and gutter widths
@columns: 12;
@column-width: 60;
@gutter-width: 20;
// Remove the definition below for a pixel-based layout
@total-width: 100%;
#
# Get appraised value of car from Edmunds.com using the developer API with R
# Reference: http://developer.edmunds.com/docs/read/The_Vehicle_API
#
# set working dir
setwd('~/R/carvalue')
#load libraries
library(RJSONIO)
@ilovejs
ilovejs / BrowserDetect.js
Created February 5, 2014 00:06
detect browser
/*
BrowserDetect.browser == 'Explorer';
BrowserDetect.version <= 8;
*/
var BrowserDetect =
{
init: function () {
this.browser = this.searchString(this.dataBrowser) || "Other";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
},
@ilovejs
ilovejs / global.R
Created February 15, 2014 02:44 — forked from hrbrmstr/global.R
library(shiny)
library(ggplot2)
library(RCurl)
library(reshape2)
(loop [i 0]
(if (< i 10)
(recur (inc 1))
i))
(str "2 is " (if (even? 2) "even" "odd"))
(if (true? false) "impossible!")
(defn factorial [x]
@ilovejs
ilovejs / Install Lein
Last active August 29, 2015 13:57
Installation Leiningen
//remove lein
rm -r ~/.m2
echo $PATH
ls /usr/bin | grep lein
...
rm -r /usr/bin/lein
//install lein
wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
sudo mv lein /usr/bin/lein
$ sudo apt-get remove mplayer
$ sudo apt-get --purge remove lighttpd
//To list all installed package
dpkg --list
dpkg --list | less
dpkg --list | grep -i 'http'
#!/usr/bin/env ruby
# Please read http://otobrglez.opalab.com for more information about this code.
class Book < Struct.new(:title)
def words
@words ||= self.title.gsub(/[a-zA-Z]{3,}/).map(&:downcase).uniq.sort
end