This file contains 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
const functions = require('firebase-functions'); | |
const TelegramBot = require('node-telegram-bot-api'); | |
const token = "***" | |
const chatID = 1024 // your telegram id, you must first send a message to your bot | |
exports.notifyIAP = functions.analytics.event('in_app_purchase').onLog((event) => { | |
const purchaseValue = event.valueInUSD; | |
if (purchaseValue > 0) { | |
const bot = new TelegramBot(token, {polling: false}); |
This file contains 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 urllib.parse | |
def urlencode(str): | |
return urllib.parse.quote(str) | |
def urldecode(str): | |
return urllib.parse.unquote(str) | |
str = '{"name": "Kinkin"}' |
This file contains 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 UIKit | |
import PlaygroundSupport | |
// https://gist.github.com/erica/6f13f3043a330359c035e7660f3fe7f5 | |
// Original Video: https://www.youtube.com/watch?v=TTmWUSgNOHk | |
// Video: https://www.youtube.com/watch?v=hmAB3WJOQTU | |
// Video: https://www.youtube.com/watch?v=DWtavuvmKdw (with zoom and fade) | |
// String to animate and its attributes | |
var string = "Hello, playground" | |
let attributes: [String: Any] = [ |
This file contains 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 readline = require('readline'), | |
fs = require('fs'); | |
var LinkMap = function(filePath) { | |
this.files = [] | |
this.filePath = filePath | |
} | |
LinkMap.prototype = { | |
start: function(cb) { |
This file contains 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
[program:tomcat6] | |
command=/opt/tomcat6-instance/bin/supervisor-wrapper.sh |
This file contains 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
//http://www.scottklarr.com/topic/425/how-to-insert-text-into-a-textarea-where-the-cursor-is/ | |
function insertAtCaret(areaId,text) { | |
var txtarea = document.getElementById(areaId); | |
var scrollPos = txtarea.scrollTop; | |
var strPos = 0; | |
var br = ((txtarea.selectionStart || txtarea.selectionStart == '0') ? | |
"ff" : (document.selection ? "ie" : false ) ); | |
if (br == "ie") { | |
txtarea.focus(); | |
var range = document.selection.createRange(); |
This file contains 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
/** | |
* Convenience method to create a MediaPlayer for a given resource id. | |
* On success, {@link #prepare()} will already have been called and must not be called again. | |
* <p>When done with the MediaPlayer, you should call {@link #release()}, | |
* to free the resources. If not released, too many MediaPlayer instances will | |
* result in an exception.</p> | |
* | |
* @param context the Context to use | |
* @param resid the raw resource id (<var>R.raw.<something></var>) for | |
* the resource to use as the datasource |