Skip to content

Instantly share code, notes, and snippets.

View pTinosq's full-sized avatar
🤖
+ 🥗

Tinos pTinosq

🤖
+ 🥗
View GitHub Profile
@simmsb
simmsb / eval.py
Last active January 30, 2024 05:39
A good eval for discord.py
import ast
import discord
from discord.ext import commands
def insert_returns(body):
# insert return stmt if the last expression is a expression statement
if isinstance(body[-1], ast.Expr):
body[-1] = ast.Return(body[-1].value)
@haxpor
haxpor / blender_cube_creation.py
Created January 15, 2017 17:38
Blender Python script to create a new cube, rename it along with set its to new location
import bpy
def strVector3( v3 ):
return str(v3.x) + "," + str(v3.y) + "," + str(v3.z)
# create a new cube
bpy.ops.mesh.primitive_cube_add()
# newly created cube will be automatically selected
cube = bpy.context.selected_objects[0]
@debojitkakoti
debojitkakoti / api.php
Created January 28, 2014 10:14
Simple API in PHP to return data in JSON format
<?php
include_once 'db.php';
global $con;
define('ERROR','404');//Define Your Error message HERE
define('REQADDR', '127.0.0.1');//Define your REQUESTIN SERVER ADDR
if($_SERVER['REMOTE_ADDR']=='127.0.0.1'){
//process it
if(isset($_GET['q'])){
$q=mysql_real_escape_string($_GET['q']);//TO get rid of SQL Enjection