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
package ai.luka.subscriptions.services.stripe; | |
import com.stripe.exception.StripeException; | |
import com.stripe.model.Invoice; | |
import com.stripe.model.InvoiceItem; | |
import com.stripe.model.PaymentIntent; | |
import com.stripe.param.InvoiceCreateParams; | |
import com.stripe.param.InvoiceFinalizeInvoiceParams; | |
import com.stripe.param.InvoiceItemCreateParams; |
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 pyperclip | |
import random | |
weight = 0.0 | |
users = [] | |
# "Bob 25\nAlice 41\nRonald McDonald 101" | |
# s = pyperclip.paste().splitlines() | |
for l in s: | |
l = l.split(' ') | |
name = ' '.join(l[:-1]) | |
comments = int(l[-1]) |
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
## prepare as: | |
# conda create -n py37 -c anaconda python=3.7 | |
# source activate py37 | |
# python --version | |
# python py37_gc_freeze_test.py | |
from multiprocessing import Process | |
import gc | |
import time |
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
from multiprocessing import Process | |
import gc | |
a = None | |
def foo(): | |
s = 0 | |
for i in a: | |
s += i | |
print("s=%d" % s) |
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 os | |
from collections import * | |
def tree(root): | |
result = [] | |
for sub in os.listdir(root): | |
subf = root + '/' + sub | |
if os.path.isfile(subf): | |
result.append(subf) | |
elif os.path.isdir(subf): |
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
trait EventListener[EventType] { | |
type Listener = (EventType) => Unit | |
var listeners = List.empty[Listener] | |
def +(f: Listener ) = f :: listeners | |
def -(f: Listener) = ... | |
def notify(event: EventType) = listeners.foreach{ l => l(event) } | |
def removeAll = listeners = Nil | |
} | |
class Button { |
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
# encoding: utf-8 | |
module ConditionsBuilder | |
def build_sql_conditions(_from, _to, conditions_op = nil) | |
from = Time.new - 60.days | |
to = Time.new | |
from = Time.at(_from.to_i) if _from.to_i > 0 | |
to = Time.at(_to.to_i) if _to.to_i > 0 | |
from = from.getutc.beginning_of_day() | |
to = to.getutc.end_of_day() |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Test</title> | |
<script src="assets/jquery.js" type="text/javascript"></script> | |
<!-- JS SQL PARSER https://github.com/forward/sql-parser --> | |
<script src="assets/sql-parser.js" type="text/javascript"></script> | |
<!-- http://redquerybuilder.appspot.com/ --> |