Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>3D Rose(By JS)</title>
</head>
<body>
<canvas id="c"></canvas>
<script>
var b = document.body;
var c = document.getElementsByTagName('canvas')[0];
b = math.ceil(math.atan(a - 100) / math.pi * 2)
b = Math.ceil(Math.atan(a - 100) / Math.PI * 0.9);
@013231
013231 / simNames.py
Created May 3, 2012 19:33
Generate similar names.
import itertools
def simNames(name):
elements = []
for ch in name:
if ch == '0' or ch == 'o':
elements.append(['0', 'o'])
elif ch == '1' or ch == 'i' or ch == 'l':
elements.append(['1', 'i', 'l'])
else:
@013231
013231 / genPw.py
Created June 16, 2012 09:19
Generate password
# Copyright 2012 new013231@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@013231
013231 / genPw.js
Created June 16, 2012 09:27
Generate password
/* ========================================================================
* Copyright 2012 new013231@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@013231
013231 / calcPw.cs
Created June 16, 2012 09:29
Generate password
/* ========================================================================
* Copyright 2012 new013231@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
#!/usr/bin/env python
from flask import Flask
from time import sleep
application = Flask(__name__)
application.debug = True
@application.route('/a')
@application.route('/b')
#!/bin/sh
count=0
IFS=$'\n'
for filename in `find *.txt`
do
destDir="AAA$((count / 500 + 1))"
if (($count % 500 == 0 ))
then
echo mkdir $destDir
#!/usr/bin/env python
import os
import shutil
count = 0
for filename in os.listdir('.'):
if filename.endswith('.txt') and os.path.isfile(filename):
destDir = 'AAA%d' % (count / 500 + 1)