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
var crypto = require('crypto'); | |
var data = "中あ"; | |
// data="bestwellgoodwill" | |
console.log('Original cleartext: ' + data); | |
var algorithm = 'aes-256-cbc'; | |
var key = 'hello'; | |
var clearEncoding = 'utf8'; | |
//var cipherEncoding = 'hex'; | |
//If the next line is uncommented, the final cleartext is wrong. | |
var cipherEncoding = 'binary';// or base64 |
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
#!/bin/bash -e | |
echo "### Download Pixmicat" | |
curl -o ${OPENSHIFT_DATA_DIR}/pixmicat.zip https://codeload.github.com/Kennyl/pixmicat/zip/develop | |
curl -o ${OPENSHIFT_DATA_DIR}/pixmicat_modules.zip https://codeload.github.com/Kennyl/pixmicat_modules/zip/develop | |
pushd ${OPENSHIFT_DATA_DIR} |
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
//-----------------------------------------------// | |
// I2C / SPI LCD BACKPACK LIBRARY FOR SPARK CORE // | |
//===============================================// | |
// Copy this into a new application at: // | |
// https://www.spark.io/build and go nuts! // | |
// !! Pinouts on line 427 below !! // | |
//-----------------------------------------------// | |
// Technobly / BDub - Jan 16th 2014 // | |
//===============================================// | |
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
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='nobody'; GIT_AUTHOR_EMAIL='nobody@localhost'; GIT_COMMITTER_NAME='nobody'; GIT_COMMITTER_EMAIL='nobody@localhost';" HEAD |
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
#openshift instead php mod memcached | |
#need compile following | |
#apt-get install libsasl2-2 sasl2-bin libsasl2-2 libsasl2-dev libsasl2-modules libevent-dev | |
# libsasl2-2 sasl2-bin libsasl2-modules | |
pushd ${OPENSHIFT_RUNTIME_DIR}/tmp | |
wget ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz | |
tar -zxf cyrus-sasl-2.1.26.tar.gz | |
cd cyrus-sasl-2.1.26 |
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
// npm install telegraf telegraf-wit | |
var Telegraf = require('telegraf') | |
var TelegrafWit = require('telegraf-wit') | |
var app = new Telegraf(process.env.BOT_TOKEN) | |
var wit = new TelegrafWit(process.env.WIT_TOKEN) | |
app.use(Telegraf.memorySession()) |
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
// use it on mouser over will replace all whitespace when human interacts it | |
this.href='mailto:'+ (this.innerHTML=this.innerHTML.replace(/ /g,'')) | |
/*<a id="e" href="#" onmouseover="this.href='mailto:'+ (this.innerHTML=this.innerHTML.replace(/ /g,''))">abc @ efg.com</a>*/ |
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
pip3 install --upgrade git+https://github.com/aerkalov/ebooklib |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from PIL import Image, ImageDraw, ImageFont #dynamic import | |
gif='a.gif' | |
img = Image.open(gif) | |
img.save(gif+".png",'png', optimize=True, quality=70) |
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
git checkout --orphan tmp | |
git add . | |
git commit -m "init" | |
git push --force --set-upstream origin master | |
git branch -d master | |
git branch -m tmp master |
OlderNewer