Skip to content

Instantly share code, notes, and snippets.

@fatbigbright
fatbigbright / Program.cs
Created April 18, 2018 13:13
Take a look at Environment
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CLRviaCsharp_00
{
class Program
{
import java.io.*;
public class HelloWorld {
static class Foo {
public int x;
public Foo(int in)
{
x = in;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
public class Foo
{
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Boostrap Number</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
.input-group{ text-align: center; padding: 5px; }
</style>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
Date.prototype.getWeekOfMonth = function(){
var dayOfWeek = this.getDay() + 1;
var day = this.getDate();
return Math.ceil((day - dayOfWeek) / 7) + ((dayOfWeek >= 0) ? 1 : 0);
};
Date.prototype.getDayCountOfMonth = function(){
var month = this.getMonth() + 1;
var isLeapYear = (function(date){
var year = date.getFullYear();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NewFeatures
{
//1. Using Static Members
using static System.Math;
@fatbigbright
fatbigbright / cpSameFile
Created July 16, 2014 23:01
将sourceDir目录中与sameWithDir目录同名的文件拷贝到targetDir中
require 'fileutils'
def cpSameFile(sourceDir, targetDir, sameWithDir)
Dir.foreach(sameWithDir) do |file|
puts file
filePath = sourceDir + "/" + file
targetPath = targetDir + "/" + file
if file == "." or file == ".." or File.directory?(file)
else
if File.exist?(filePath)
FileUtils.cp filePath, targetPath
@fatbigbright
fatbigbright / test jQuery
Created July 10, 2014 08:49
Test jQuery to find what selector can do.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TRY</title>
<style>
div{
width: 100px;
height: 40px;
}
@fatbigbright
fatbigbright / get png list
Last active August 29, 2015 13:57
遍历一个目录的所有png图片文件,按照特定格式将它们列入一个markdown文件中。在windows+ruby1.8.7下测试通过。作为PSP《战律星云》汉化项目的命令行工具。
def outputImage(directory, target)
File.open(target, 'w') do |t|
Dir.foreach(directory) do |file|
puts file
if File.extname(file) == ".png"
t.puts "\#\##{file}"
t.puts "\!\[#{file}\]\(.\\img\\#{file}\)"
t.puts
end
end
@fatbigbright
fatbigbright / async demo
Created March 26, 2014 02:32
一个简单的异步执行demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test page</title>
<script>
window.onload = function(){
var slowTask = function(callback){
setTimeout(function(){
callback();