Skip to content

Instantly share code, notes, and snippets.

View Lax's full-sized avatar

Liu Lantao Lax

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@enaeher
enaeher / tiered_archives.rb
Created September 5, 2011 21:49
Tiered Archives plugin
# A quick and dirty plugin for Jekyll by Eli Naeher
#
# This plugin creates a site.years template variable which allow you to group archive links by year and month.
# The structure of site.years is:
# site.years = 2001=>[[post1, post2...], [...]], 2002=>[...]
#
# Usage should look something like this:
# {% for year in site.years %}
# <h2>Year {{ year.first.first.date | date: "%Y" }}</h2>
@TooTallNate
TooTallNate / Run.js
Created September 27, 2011 21:04 — forked from bored-engineer/Run.js
MobileDevice NodObjC basic example.
var $ = require('NodObjC')
$.import('MobileDevice');
$.import('CoreFoundation')
// Callback function that's invoked when a device is plugged in
function callback (info, foo) {
try {
console.log('inside callback!')
var i = new $.am_device_notification_callback_info(info)
@jedi4ever
jedi4ever / gist:1376525
Created November 18, 2011 14:00
Ganglia - Gmond packet listener in Ruby - Proof of Concept
require 'socket'
require 'pp'
require 'xdr'
# Inspiration
# https://github.com/fastly/ganglia/blob/master/lib/gm_protocol.x
# https://github.com/igrigorik/gmetric/blob/master/lib/gmetric.rb
# https://github.com/ganglia/monitor-core/blob/master/gmond/gmond.c#L1211
# https://github.com/ganglia/ganglia_contrib/blob/master/gmetric-python/gmetric.py#L107
#include "mruby.h"
#include "mruby/proc.h"
#include "compile.h"
#include "mruby/dump.h"
#include <stdio.h>
#include <string.h>
void ruby_show_version(mrb_state *);
void ruby_show_copyright(mrb_state *);
void parser_dump(mrb_state*, struct mrb_ast_node*, int);
@alloy
alloy / 1-README.md
Created July 5, 2012 16:01
RubyMotion MacBacon UI layer spec.
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@seanlilmateus
seanlilmateus / gist:4134454
Last active January 12, 2018 16:11
Rubymotion GCD Future; with lazy evaluation
#!/usr/bin/env macruby -wKU
framework 'Foundation'
module Dispatch
module Futuristic
def proxy
Class.new(BasicObject) do
def initialize(obj)
@obj = obj
end
@kennyz
kennyz / kongwu_pi_tips.md
Last active December 25, 2021 12:41
kongwu pi tips

折腾Pi,解决疑难杂症最好还是去官网论坛

image http://www.raspberrypi.org/phpBB3/

支持Apple TimeMachine,实现Mac备份

在磁盘中创建备份目录 mkdir /media/usbdisk/mactimebak 推荐使用ext4分区(打开notime)

安装nettalk