This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DateUtil | |
{ | |
public static long CurrentTimestamp() | |
{ | |
return DateToTimestamp(DateTimeOffset.UtcNow); | |
} | |
public static long DateToTimestamp(DateTimeOffset date) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static string NumToKr(decimal val) | |
{ | |
var exp = Math.Log10((double)val); | |
var baseLines = new Dictionary<int, string> { | |
[16] = "경", | |
[12] = "조", | |
[8] = "억", | |
[4] = "만" | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# | |
# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. | |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
# | |
# This code is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License version 2 only, as | |
# published by the Free Software Foundation. Oracle designates this | |
# particular file as subject to the "Classpath" exception as provided | |
# by Oracle in the LICENSE file that accompanied this code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function submitForm($form) { | |
var defer = new $.Deferred(); | |
var xhr = new XMLHttpRequest(); | |
xhr.open($form.attr('method'), $form.attr('action'), true); | |
xhr.onload = function(e) { | |
if (xhr.status >= 200 && xhr.status < 300) { | |
defer.resolve(xhr); | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".elements-with-tooltips").on('show', function (e) { | |
if ('ontouchstart' in document.documentElement) e.preventDefault() | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>rating</title> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/bootstrap/3.1/css/bootstrap.min.css"> | |
<style> | |
.star-rating i { | |
font-size: 24px; | |
color: #ddd; | |
cursor: pointer; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
menuCommandString,UI MenuString zh_CN | |
------------------------------------- | |
new,新建 | |
newFromTemplate,从模板新建 | |
open,打开 | |
saveacopy,存储副本 | |
Adobe AI Save For Web,存储为 Web 所用格式(W) | |
Adobe AI Save Selected Slices,存储选中的切片 | |
revert,恢复 | |
AI Place,置入(L) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wand.image import Image | |
with Image(filename='z:\\photo.jpg') as img: | |
width, height = img.size | |
offset_top = 0 | |
offset_left = 0 | |
if width > height: | |
offset_left = (width - height) / 2 | |
size = height | |
elif height > width: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
def getTerminalSize(): | |
import platform | |
current_os = platform.system() | |
tuple_xy=None | |
if current_os == 'Windows': | |
tuple_xy = _getTerminalSize_windows() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) { | |
var password_text = "password_text"; | |
var db = new Rfc2898DeriveBytes(password_text, 32, 10000); | |
var salt = db.Salt; | |
var hash = db.GetBytes(32); | |
var pass = Convert.ToBase64String(hash); | |
Console.WriteLine(pass); |
NewerOlder