Skip to content

Instantly share code, notes, and snippets.

View cosme12's full-sized avatar
🐍
Working from home

Diego Lanciotti cosme12

🐍
Working from home
  • Argentina
View GitHub Profile
anonymous
anonymous / lol.php
Created December 13, 2012 15:15
Chatterbox Extensions.
<?php
header("Content-type: text/plain");
$logfile = "log.txt";
$msg = $_POST['message'];
$contents = file_get_contents($logfile);
if(isset( $_POST['clear'] ) || isset( $_GET['clear'] )) {
file_put_contents($logfile, "");
-- spacy adventure
-- by @egordorichev
--
-- main callbacks
--
cartdata("ld39")
t=1
dmg=5
@CoachBirgit
CoachBirgit / sample.html
Created January 13, 2016 16:00
Sample HTML to add "Made with Love" to your site footer with the Genesis Framework.
<p class="love">Made with <i class="icon ion-heart"></i> by Brian Gardner</p>
import gym
import numpy as np
import random
import math
from time import sleep
## Initialize the "Cart-Pole" environment
env = gym.make('CartPole-v0')
@danielpataki
danielpataki / basics.php
Last active April 5, 2019 13:00
Creating a Plugin
<?php
/**
* Plugin Name: My Facebook Tags
* Plugin URI: http://danielpataki.com
* Description: This plugin adds some Facebook Open Graph tags to our single posts.
* Version: 1.0.0
* Author: Daniel Pataki
* Author URI: http://danielpataki.com
* License: GPL2
*/
@bketelsen
bketelsen / gaweb.service
Created December 5, 2017 20:10
systemd unit file for a go web app
# /etc/systemd/system/gaweb.service
[Unit]
Description=gopheracademy website
[Service]
PIDFile=/tmp/gaweb.pid-3001
User=gaweb
Group=gaweb
Environment=GO_ENV=production
Environment=POSTGRES_PASSWORD=SomePassWord
@Ivoah
Ivoah / 3d.lua
Created July 8, 2015 20:43
3D Demo for PICO-8 (http://www.lexaloffle.com/pico-8.php) with comments
--3demo
--simple 3d demo
-- Here is the data for the 3d model
-- The first section is the 3d location
-- of each point on the cube, and the
-- second section is the lines that
-- connect the points
cube = {{{-1,-1,-1}, -- points
{-1,-1,1},
@twolfson
twolfson / README.md
Last active April 19, 2021 01:10
generals.io strategies

We played generals.io over the weekend. It gives some solid adrenaline rushes but we are prob going to take a break from it due to that and other priorities.

Quick tips:

  • Use click + WASD to queue up traversals quickly (on your own squares you can chain it multiple times)
  • Cities repopulate if not fully captured, be sure to have +2 to city count (1 for wipe out, 1 for move in)

Here is what we learned as some strategies:

  • In 1v1, maps are set up with generals at 2 sides (e.g. North/South, East/West, Northwest/Southeast)
@lrvick
lrvick / flask_geventwebsocket_example.py
Created September 1, 2011 07:17
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@mattbennett
mattbennett / app.py
Last active November 19, 2021 10:12
Nameko celery integration
from flask import Flask, request
from nameko.standalone.rpc import ServiceRpcProxy
app = Flask(__name__)
@app.route('/')
def task_list():
return """
<html>