Skip to content

Instantly share code, notes, and snippets.

View ccjeng's full-sized avatar

Andy Cheng ccjeng

  • Taiwan
View GitHub Profile
@ccjeng
ccjeng / FirebaseRemoteConfig.java
Last active September 26, 2016 04:30
Firebase Remote Config
final FirebaseRemoteConfig mRemoteConfig = FirebaseRemoteConfig.getInstance();
// cache expiration in seconds
long cacheExpiration = 3600; //1 hour
//Settings
FirebaseRemoteConfigSettings remoteConfigSettings = new FirebaseRemoteConfigSettings.Builder()
.setDeveloperModeEnabled(true)
.build();
mRemoteConfig.setConfigSettings(remoteConfigSettings);
@ccjeng
ccjeng / TextToSpeech.swift
Created November 3, 2016 05:41
Swift TextToSpeech sample
import UIKit
import AVFoundation
class ViewController: UIViewController {
@IBOutlet weak var txtFieldText: UITextField!
@IBOutlet weak var labelMessage: UILabel!
let synth = AVSpeechSynthesizer()
var myUtterance = AVSpeechUtterance(string: "")
@ccjeng
ccjeng / gulpfile.js
Last active April 10, 2017 02:25
gulpfile.js
'use strict';
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var cssminify = require('gulp-clean-css');
var imagemin = require('gulp-imagemin');
var connect = require('gulp-connect');
var livereload = require('gulp-livereload');
@ccjeng
ccjeng / productkey.vbs
Created November 25, 2020 00:38
Get Windows 7 Product Key
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0