Skip to content

Instantly share code, notes, and snippets.

View thinkhy's full-sized avatar
🐕
On vacation

thinkhy thinkhy

🐕
On vacation
View GitHub Profile
@thinkhy
thinkhy / gist:9188745
Created February 24, 2014 13:49
Earth's rotation from dayside and nightside
figure
load('topo.mat','topo','topomap1');
[x,y,z] = sphere(50);
cla reset
axis square off
props.AmbientStrength = 0.1;
props.DiffuseStrength = 1;
props.SpecularColorReflectance = .5;
props.SpecularExponent = 20;
props.SpecularStrength = 1;

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sun, 03 Mar 2013 21:51:11 GMT till Mon, 03 Mar 2014 21:51:11 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -> user.followers > 246)
@thinkhy
thinkhy / smtp.pl
Last active August 29, 2015 13:59
Test SMPT server
use strict;
use warnings;
use Net::SMTP;
my $smtpserver = 'mail.server.com';
my $smtpport = 25;
my $smtpuser = 'test';
my $smtppassword = 'test';
@thinkhy
thinkhy / sendmail.mc
Created April 11, 2014 16:25
sendmail configuration file
divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl # /etc/mail/make
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
@thinkhy
thinkhy / gethandouts.pl
Last active August 29, 2015 14:00
Download SHARE handouts automatically.
#!/usr/bin/perl -w
##################################################################
#
# Code on github: https://gist.github.com/thinkhy/11027824
#
##################################################################
use LWP::Simple;
use HTML::LinkExtor;
use URI::URL;
use URI::Escape;
@thinkhy
thinkhy / dupfile_by_rxf.sh
Created October 23, 2014 16:16
RenXiaoFeng's homework about identifying duplicate files
#!/bin/bash
path="."
tmp="/tmp/mydir"
mkdir -p $tmp
chksum() {
_filename=$@
_size=$(stat -c %s "$_filename")
_hash=$(dd if=$1 bs=1M count=1 2>/dev/null | md5sum | awk '{print $1;}')
@thinkhy
thinkhy / cs162-firstAssignment.md
Last active August 29, 2015 14:21
CS162-2015-FirstAssignment

CS162 assignment -- first HomeWork HW0

PDF: http://cs162.eecs.berkeley.edu/static/hw/hw0.pdf

3.1 make

You have probably been using gcc to compile your programs, but this grows tedious and complicated as the number of files you need to compile increases. You will need to write a Makefile that compiles main.c, wc.c, and map.c. You will also need to write a target check that runs some sort of test that will verify the output of wc and main. (You may do this any way you wish, but you MUST verify that

@thinkhy
thinkhy / cs162-2015-section2.md
Last active August 29, 2015 14:22
cs162-2015-section2.md
@thinkhy
thinkhy / cs162-2015-section3-thread.md
Last active August 29, 2015 14:22
cs162-2015-section3-thread.md