Skip to content

Instantly share code, notes, and snippets.

View bendtherules's full-sized avatar
💭
Loving Typescript ...

Abhas Bhattacharya bendtherules

💭
Loving Typescript ...
View GitHub Profile
from flask import Flask
from flask import *
# import redis
app = Flask(__name__)
fname = r"E:/much.txt"
# db = redis.StrictRedis(host='localhost', port=6379, db=0)
# db.client_setname("Url_shortener")
# db_list_user_name = "user"
---bug_file.py---
import math,another_file
a=another_file.class_a()
--another_file.py--
class class_a():
def __init__(self):
print(math.cos(0))
import pygame
class ball(object):
global mouse_down
#global pygame
def __init__(self,x=320,y=240,speed=3):
#global pygame
self.x=x
self.y=y
self.speed=speed
self.dir=None
import sys,pygame,math;
from class_ball import ball
pygame.init()
clock = pygame.time.Clock()
size=width,height=640,480
#x=320
#y=240
#speed=3
#dir=None
black=0,0,0
class TODOList {
...
...
addNewTodo(todoText){
this.todos. ??
}
}
@bendtherules
bendtherules / hooks-demo.jsx
Created January 20, 2019 14:39
Demo code with react hooks
import { useState } from 'react';
function Example() {
// Declare a new state variable, which we'll call "count"
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
@bendtherules
bendtherules / ruleSlow.js
Last active March 19, 2019 10:58
Slow down getStatus request
// change to slow down get order status
module.exports = {
summary: 'slow down placing order (https)',
*beforeDealHttpsRequest(requestDetail) {
return true;
},
*beforeSendRequest(requestDetail) {
const newRequestOptions = requestDetail.requestOptions;
// set rejectUnauthorized as false
newRequestOptions.rejectUnauthorized = false;
*{background:#5d3a3a;margin:0;}p{width:200px;height:200px;background:#b5e0ba;}
@bendtherules
bendtherules / try.graphql
Last active May 23, 2019 05:28
github_graphql
{
repositoryOwner(login: "bendtherules") {
repositories(first: 100, isFork: true) {
nodes {
id
nameWithOwner
refs(refPrefix: "refs/heads/", last: 100) {
edges {
node {
branchName: name
@bendtherules
bendtherules / IsPropertyReference.js
Last active March 19, 2020 14:14
IsPropertyReference? - Example for foo.bar() article
// IsPropertyReference?
// 1. Different notations for accessing a property name
foo.bar() // ✅
foo["any string here"]() // ✅
// 2 Property name can also be a symbol - inbuilt or custom
someArray[Symbol.iterator].toString() // ✅