Skip to content

Instantly share code, notes, and snippets.

View Orenoid's full-sized avatar

Orenoid

View GitHub Profile
@sergiolucero
sergiolucero / graphqlapp.py
Created June 20, 2019 13:33
basic flask-graphql app
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import os
import graphene
from graphene_sqlalchemy import SQLAlchemyObjectType, SQLAlchemyConnectionField
from flask_graphql import GraphQLView
#################################
app = Flask(__name__)
app.debug = True
@ludoo0d0a
ludoo0d0a / macos_finder_open_folder_in_IntelliJ
Last active April 20, 2023 06:14
Open folder into IntelliJ from MacOs Finder
# How to oget an icon to easily open folder into IntelliJ from MacOs Finder
Use tools made with Automator (better, faster, stronger...) :
https://github.com/ludoo0d0a/open-in-buttons-for-finder-toolbar
:)
# Here is the old deprecated way :
(Multiple finder or multiple idea projects works badly)
我本想享受生活,结果发现活下来都很困难。
你的计划,就像零食,吃到肚子里之后就是个屁。
我已经不是那个花五十块钱,也要考虑很久的小孩了,现在五块钱都要深思熟虑。
今天天气很好,在房间里宅久了,准备去客厅散散心。
春节你要小心了,毕竟过年,都是要杀猪的。
经过多年的打拼,虽然没有什么收获,但你有债呀!
人为什么叫人类,因为人活着就是累。
说错话不要紧,你还会继续说错的。
你倒下了,能顶替你的人千千万
你获得了很多金钱,但同时也失去了很多东西,比如烦恼。
@popstas
popstas / docker-logs-localtime
Last active August 2, 2023 09:04
docker-logs-localtime - Replace all UTC dates in docker logs output to local dates in pipe
#!/usr/bin/env node
// replace all UTC dates to local dates in pipe
// usage: docker logs -t container_name | docker-logs-localtime
// install:
// curl https://gist.githubusercontent.com/popstas/ffcf282492fd78389d1df2ab7f31052a/raw/505cdf97c6a1edbb10c3b2b64e1836e0627b87a0/docker-logs-localtime > /usr/local/bin/docker-logs-localtime && chmod +x /usr/local/bin/docker-logs-localtime
// alternative: https://github.com/HuangYingNing/docker-logs-localtime
const pad = d => (d > 9 ? d : '0' + d);

has to type javascript: manually... (

copy to pc browser's address bar

javascript:f=function(){x=window.innerWidth*Math.random();y=window.innerWidth*Math.random();$('canvas').trigger(jQuery.Event("mousedown",{clientX:x,clientY:y})).trigger(jQuery.Event("mouseup", {clientX:x,clientY:y}))};setInterval(f,1500*Math.random());setInterval(f,1500*Math.random())

copy to mobile browser's address bar (a little bit difficult...

@joncardasis
joncardasis / WebServer.py
Created February 7, 2017 21:08
A simple and quick HTTP web server in Python
"""
Author: Jonathan Cardasis
"""
import socket
import signal # Allow socket destruction on Ctrl+C
import sys
import time
import threading
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 23, 2024 12:17
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@sanchitgangwar
sanchitgangwar / snake.py
Created March 22, 2012 12:38
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@geoffalday
geoffalday / secretkey.py
Created March 12, 2012 12:28
How to generate a secret key with Python
# How to generate a secret key with Python
# via http://flask.pocoo.org/docs/quickstart/
import os
os.urandom(24)