Skip to content

Instantly share code, notes, and snippets.

View EddieOne's full-sized avatar
🕶️

+EddieJ EddieOne

🕶️
View GitHub Profile
@nicolechung
nicolechung / sendData.as
Created March 22, 2012 12:03
Actionscript: Send Data to PHP
public function sendData(url:String, vars:URLVariables)
{
var req:URLRequest = new URLRequest(url);
req.data = vars;
req.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT; // URLLoaderDataFormat.VARIABLES will cause error #2101
loader.load(req);
loader.addEventListener(Event.COMPLETE, loadComplete, false, 0, true);
@achoukah
achoukah / blank-html-page.html
Last active June 24, 2024 00:16
html blank page
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="description" content="Webpage description goes here" />
<meta charset="utf-8">
<title>Change_me</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="">
<link rel="stylesheet" href="css/style.css">
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 20, 2024 11:27
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@julianeon
julianeon / http-escalation-put.rb
Created May 28, 2014 00:34
PUT example using HTTParty.
require 'httparty'
subdomain='FAKE'
api_token='FAKE'
id='FAKE'
endpoint="https://#{subdomain}.pagerduty.com/api/v1/escalation_policies/#{id}"
token_string="Token token=#{api_token}"
data= {
name: "New name"
@longlostnick
longlostnick / uploads_controller.rb
Created June 17, 2014 18:20
Rails JSON file upload with carrierwave (from base64 string)
class Api::UploadsController < ApiController
def create
@upload = Upload.new(upload_params)
ensure
clean_tempfile
end
private
@mjul
mjul / form_to_opencv.py
Created July 2, 2014 19:27
Decode Python (Flask or Werkzeug) photo file uploaded via HTTP POST request in-memory to an OpenCV matrix.
#
# Example from code built on the Flask web framework (and Werkzeug)
# Accepts uploading a photo file in the 'photo' form member, then
# copies it into a memory byte array and converts it to a numpy array
# which in turn can be decoded by OpenCV.
#
# Beware that this increases the memory pressure and you should
# configure a max request size before doing so.
#
# It saves a round-trip to a temporary file, though.