Skip to content

Instantly share code, notes, and snippets.

View luckydonald's full-sized avatar
👀
294 people are currently looking at this profile

Luckydonald luckydonald

👀
294 people are currently looking at this profile
  • Some basement in Equestria.
View GitHub Profile
@huiliu
huiliu / app.py
Created December 8, 2015 17:12
Flask Streaming from Templates
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, stream_with_context, request, Response, flash
from time import sleep
app = Flask(__name__)
def stream_template(template_name, **context):
@faresd
faresd / gist:5661253
Created May 28, 2013 08:14
AppleScript restore multiple files from trash Mac os
try
delay 15 -- adjust delay as needed
repeat 40000 times
try
tell application "Finder" to close every window
delay 0.09 -- adjust delay as needed
set theDigit to func(37)
on error
do shell script "killall Finder"
delay 10 -- adjust delay as needed
@asimjalis
asimjalis / python-zip.md
Created December 7, 2012 23:33
How to deploy a Python application as a zip file

How to deploy a Python application as a zip file

by Asim Jalis, MetaProse.com

Create a file __main__.py containing:

print "Hello world from Python"

Zip up the Python files (in this case just this one file) into app.zip by typing:

@miohtama
miohtama / gist:34a83d870a14aa7e580d
Last active October 31, 2021 13:21
Safe evaluation of math expressions in Python, using byte code verifier and eval()
""""
The orignal author: Alexer / #python.fi
"""
import opcode
import dis
import sys
import multiprocessing
@etra0
etra0 / README.md
Last active December 27, 2020 19:44

I did this exercise in order to learn about internal hacking using DLL injection and interfacing ASM with Rust.

This code will not compile by itself, you need to create the rust structure which should look something like this

dll
├── Cargo.toml
├── build.rs
└── src
    ├── interceptor.asm
 └── lib.rs
@andrewgross
andrewgross / travis_webhook_checker.py
Last active November 5, 2020 15:10
Django View to check travis CI webhook signatures. Requires Django, python-requests and pyOpenSSL packages
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import json
import logging
from urlparse import parse_qs
import requests
@m0n5t3r
m0n5t3r / gist:1006281
Created June 3, 2011 12:50
set x-forwarded-ssl correctly (nginx, http+https in the same config)
set $ssl off;
if ($scheme = https) {
set $ssl on;
}
proxy_set_header X-Forwarded-Ssl $ssl;
@p-a-t-a-r
p-a-t-a-r / changelog.txt
Last active April 26, 2019 11:32
Derpibooru Image Slideshow (Greasemonkey Userscript for derpibooru.org)
Version 1.0.0 (05/02/2015) - Initial release
Version 1.0.1 (05/02/2015) - Added trixiebooru.org to the include list
Version 1.0.2 (05/26/2015) - Added icon to gallery slideshow button to match the May 2015 UI update
Version 1.0.3 (05/31/2015) - Changes to gallery slideshow button for May 2015 UI update (fixed positioning and made text hide on mobile)
Version 1.0.4 (06/06/2015) - Major refactoring, fixed some occurrences of duplicate history states and changed the behavior of the slideshow button on gallery pages
Version 1.1.0 (06/07/2015) - Added fave/upvote/downvote/comment buttons and scores
Version 1.1.1 (07/05/2015) - Fixed a bug that prevented the slideshow button from working on tag pages
Version 1.1.2 (07/19/2015) - Fixed a bug that prevented the slideshow button from working on search pages
Version 1.2.0 (07/20/2015) - Added HTML5 fullscreen capability
Version 1.2.1 (08/04/2015) - Bugfixes
@cwacek
cwacek / .screenrc
Created June 6, 2013 20:58
Screen RC example
# Turn off that annoying start up message
startup_message off
# Turn the even more annoying whole-screen-flash-on-tab-complete "feature"
vbell off
terminfo xterm-color hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
term xterm-color
# Window list at the bottom. hostname, centered tabs and redmarked active windows:
@thewestwind
thewestwind / bfc.cpp
Created January 15, 2015 14:30
Just some Brainfuck compiler (LLVM based)
#include "headers.h"
using namespace llvm;
using namespace std;
struct codegen {
enum insn_name {
ptr_increment, // >
ptr_decrement, // <
value_increment, // +