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
go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./api/...;./controllers/..." output:crd:artifacts:config=config/crd/bases | |
runtime: goroutine stack exceeds 1000000000-byte limit | |
fatal error: stack overflow | |
runtime stack: | |
runtime.throw(0x1784a61, 0xe) | |
/usr/local/go/src/runtime/panic.go:617 +0x72 | |
runtime.newstack() | |
/usr/local/go/src/runtime/stack.go:1041 +0x6f0 | |
runtime.morestack() |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"os" | |
"k8s.io/api/core/v1" | |
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp" | |
"sigs.k8s.io/controller-runtime/pkg/client" |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
"regexp" | |
"strings" | |
"time" |
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
import json | |
from google.appengine.ext import db | |
from datetime import datetime | |
from base import BaseHandler | |
import logging | |
from models.emails import EmailContent | |
log = logging.getLogger(__name__) | |
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
import datetime | |
from google.appengine.ext import db | |
class Image(db.Model): | |
"""Model to represent Image | |
""" | |
name = db.StringProperty(required = True) | |
data = db.TextProperty(required = True) | |
created_at = db.DateTimeProperty(auto_now_add = True) | |
updated_at = db.DateTimeProperty(auto_now = False) |
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
/* function to detect if a box of given color is visible on screen or not */ | |
is_box_visible = function(color) { | |
var selector; | |
selector = "." + color + "box:visible"; | |
return $(selector).length > 0; | |
}; | |
$.when(async_if(is_box_visible, 'green') /* green box is visible */, | |
async_if(is_box_visible, 'red') /* red box is visible */ | |
).then( |
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
/* asynchronous IF construct implementation */ | |
async_if = function(fn, args, timeout) { | |
var curr_probe, dfd, probe; | |
dfd = new jQuery.Deferred(); | |
curr_probe = null; | |
probe = function() { | |
if (fn(args)) { | |
dfd.resolve(args); /* this will invoke success callback */ |
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
async_if = (fn, args, timeout)-> | |
dfd = new jQuery.Deferred() | |
curr_probe = null | |
probe = ()-> | |
if fn(args) | |
dfd.resolve(args) | |
curr_probe = null | |
else | |
curr_probe = setTimeout probe, 5 |
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
log = logging.getLogger('') | |
rh = RedisLogHandler() #you can specify all redis params here | |
rh.setLevel(logging.WARNING) #set the filter for critical logs only | |
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') #custom formatter | |
rh.setFormatter(formatter) | |
log.addHandler(rh) |
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
import redis | |
import logging | |
class RedisLogHandler: | |
"""Log handler for logging logs in some redis list | |
""" | |
def __init__(self, host = None, port = None, db = 0, log_key = 'log_key'): | |
self._formatter = logging.Formatter() | |
self._redis = redis.Redis(host = host or 'localhost', port = port or 6379, db = db) | |
self._redis_list_key = log_key |
NewerOlder