Skip to content

Instantly share code, notes, and snippets.

View yanhaijing's full-sized avatar
🏠
Working for jsmini.cc

颜海镜 yanhaijing

🏠
Working for jsmini.cc
View GitHub Profile
@yanhaijing
yanhaijing / firstasm.asm
Created April 12, 2013 14:47
第一个汇编程序
;lt301a.asm
.model small
.stack
.data
string db 'Hello, Everybody !',0dh,0ah,'$'
.code
start: mov ax,@data
mov ds,ax
mov dx,offset string
mov ah,9
@yanhaijing
yanhaijing / upper.asm
Created April 12, 2013 14:49
小写字母转换成大写字幕
;颜海镜 2011.9.29 小写字母转换成大写字幕
;最终解释权归颜海镜所有
.model small
.stack
.data
msgkey db 'Press any key to continue ...','$'
msgin db 'input:','$'
msgout db 'output:','$'
enterr db 0dh,0ah,'$'
.code
@yanhaijing
yanhaijing / xlat317.asm
Created April 12, 2013 14:50
数制转
;颜海镜 2011.9.30
;3.17数制转换
.model small
.statck
.data
LEDtable db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h,88h,83h,0c6h,0c1h,86h,8eh
LEDnum db 01h,02h,03h,04h,05h,06h,07h,08h,09h,0ah,0bh,0ch,0dh,0eh,0fh
.code
start: mov ax,@data
mov ds,ax;初始化数据段基址
@yanhaijing
yanhaijing / mac.asm
Created April 12, 2013 14:51
包含库实验
include stdio.mac
.model samll
.stack
.data
string db 'yanhaijing','$'
.code
start: mov ax,@data
mov ds,ax;程序开始
putchar 'a'
@yanhaijing
yanhaijing / 约瑟夫环.c
Created April 13, 2013 00:59
上机约瑟夫环链表实验
/*上机约瑟夫环链表实验*/
/*版权 颜海镜 所有*/
#include<stdio.h>
#include <malloc.h>
#include "stdlib.h"
typedef struct Node
{
int data;
struct Node *next;
@yanhaijing
yanhaijing / Httplib.php
Created May 1, 2013 14:25
php访问http文件
/**
* http下载类库
*/
class Httplib{
// 目标网站无法打开时返回的错误代码
var $_ERROR_CONNECT_FAILURE = 600;
// 自定义 UserAgent 字符串
var $_SEND_USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; LazyCMS.net::DownLoader)';
var $_url,$_method,$_timeout;
var $_scheme,$_host,$_port,$_path,$_query,$_referer;
@yanhaijing
yanhaijing / refresh-website.js
Last active December 22, 2015 21:28
刷新任意网站,无限制
var total = 0
function loop(){
console.log("=====total count", total++);
$.ajax({
url: "http://mixin.tongda2000.com/?" + Math.random(),
error: function(){
loop();
},
success: function(){
loop();
@yanhaijing
yanhaijing / auto-follow-github.js
Created November 8, 2013 10:41
自动follow github帐号
(function ($) {
var
followers = ["zedshaw"];
followeds = [];
function follow(id, callback) {
$.post('https://github.com/users/follow', {target: id}, function(data, textStatus, xhr) {
/*optional stuff to do after success */
callback(id, data);
//console.log("成功follow ", id, "此人共有", data.count, "位粉丝");

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@yanhaijing
yanhaijing / qiang
Created May 23, 2014 06:09
博客园,抢汤姆大叔的书
function qiang(){
var date = new Date();
if(date.getHours() === 14 && date.getMinutes() === 0 && date.getSeconds() >=0){
$.post("http://www.cnblogs.com/mvc/PostComment/Add.aspx", '{"blogApp":"TomXu","postId":3745775,"body":"支持大叔,抢书了,我是颜海镜,http://yanhaijing.com","parentCommentId":0}', function (data) {console.log(data)}, "json");
}else{
setTimeout(function() {qiang()}, 1);
}
}