Skip to content

Instantly share code, notes, and snippets.

View naoyeye's full-sized avatar
🦾

J.Y Han naoyeye

🦾
View GitHub Profile
@xiaoyao1991
xiaoyao1991 / gmail.py
Created November 20, 2012 10:07
Sending email
import smtplib
sendto = ['[email protected]', '[email protected]', '[email protected]'] #收件人
no = [1,2,3] #编号
gmail_username = '[email protected]'
gmail_password = 'password'
smtpserver = smtplib.SMTP("smtp.gmail.com", 587)
smtpserver.ehlo()
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active October 31, 2025 16:45
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@wilsonjackson
wilsonjackson / candykeys.js
Last active December 17, 2015 02:49
Questing hot keys for Candy Box !
// Automatically creates hot keys for each potion/scroll/magic item you can use in a quest using the
// first available letter in the button's text. Special exclusions are made for keys that are used by
// the game itself — if you don't know why, I won't spoil it for you.
// Hot keys can be enabled or disabled by a button at the top of the page, or by pressing CTRL+K or
// CMD+K.
!function (undefined) {
var enabled = false, bindings = {}, reserved = 'IK';
$.each(potions.list, function (i, potion) {
var text = potion.buttonText,
/**
* scrollTop Module
*
* Just add `totop` as class or attribute to some element.
*
* This used to be plain jQuery, but we are cool now. Sadly, it
* still requires jQuery for the animation.
*
* This even works as a Facebook page, thanks to
* http://stackoverflow.com/a/8130267/1254484
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active November 29, 2025 12:10
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@justjavac
justjavac / img2txt.js
Last active December 9, 2021 06:46
img2txt:基于canvas的图片转字符画工具
var cv = document.getElementById('cv');
var c = cv.getContext('2d');
var txtDiv = document.getElementById('txt');
var fileBtn = document.getElementById("up-button");
var img = new Image();
img.src = 'a.jpg';
img.onload = init; // 图片加载完开始转换
fileBtn.onchange = getImg;
// 根据灰度生成相应字符
@namuol
namuol / INSTALL.md
Last active December 11, 2024 12:21
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@chrisb
chrisb / gist:4d6a09c6cc1ca2e1b14e
Last active November 25, 2022 04:15
Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

#!/usr/bin/env python
# To look at: https://github.com/kcrawford/mac-network/blob/master/lib/mac-network/wifi.rb
# To look at: https://stackoverflow.com/questions/28096630/mac-os-x-10-10-reorder-preferred-networks
'''
Playing around with CoreWLAN to return information about the wi-fi connection
Documentation:
https://developer.apple.com/library/mac/documentation/CoreWLAN/Reference/CWInterface_reference/translated_content/CWInterface.html
@kettuniko
kettuniko / randomcolors.js
Last active October 5, 2023 20:32
Random RGBA colors with javascript
const randomNumber = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);
const randomByte = () => randomNumber(0, 255)
const randomPercent = () => (randomNumber(50, 100) * 0.01).toFixed(2)
const randomCssRgba = () => `rgba(${[randomByte(), randomByte(), randomByte(), randomPercent()].join(',')})`