Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
xcommerce-gists / CreateAccount
Last active December 25, 2015 12:21
How to Create a PayPal Account Using Adaptive Accounts.curl
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: <Caller-UID>" # UserID from the Caller account
-H "X-PAYPAL-SECURITY-PASSWORD: <Caller-Pswd>" # Password from the Caller account
-H "X-PAYPAL-SECURITY-SIGNATURE: <Caller-Sig>" # Signature from the Caller account
-H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON"
-H "X-PAYPAL-SANDBOX-EMAIL-ADDRESS: <Caller-Sandbox-edress>"
-H "X-PAYPAL-DEVICE-IPADDRESS: 192.0.2.0"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" # Standard Sandbox App ID
@dergachev
dergachev / _msaccess_from_php.md
Last active May 17, 2018 17:11
Figuring out how to talk to MS Access from PHP

Installation

Downloaded Windows XP / IE8 image from http://www.modern.ie/en-us/virtualization-tools

curl -O "https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/OSX/IE8_XP/IE8.XP.For.MacVirtualBox.ova"
  • Virtualbox -> Import > "IE8.XP.For.MacVirtualBox.ova"
@Xophmeister
Xophmeister / long2ip.sql
Last active September 24, 2022 23:46
Oracle SQL and PL/SQL function to convert proper IPv4 address (i.e., 32-bit integer) into the standard, "dotted" format
-- We have a table (ip_log) of proper IPv4 addresses (ip)
select bitand(ip / 16777216, 255) || '.' || bitand(ip / 65536, 255) || '.' || bitand(ip / 256, 255) || '.' || bitand(ip, 255) ip
from ip_log;
-- ...or a function to do the same:
create or replace function long2ip(ip in number)
return varchar2 deterministic
as
begin
return bitand(ip / 16777216, 255) || '.' ||
@schlamar
schlamar / gist:7024668
Created October 17, 2013 13:14
Handle Windows privileges from Python. Based on http://stackoverflow.com/a/2129589/851737
from __future__ import print_function
import ctypes
from ctypes import wintypes
GetCurrentProcess = ctypes.windll.kernel32.GetCurrentProcess
GetCurrentProcess.restype = wintypes.HANDLE
OpenProcessToken = ctypes.windll.advapi32.OpenProcessToken
OpenProcessToken.argtypes = (wintypes.HANDLE, wintypes.DWORD, ctypes.POINTER(wintypes.HANDLE))
OpenProcessToken.restype = wintypes.BOOL
@dermesser
dermesser / libfcgi-example.c
Created July 3, 2014 11:14
In case anyone wants to see a multi-threaded FastCGI application written with the fcgiapp library.
# include <stdlib.h>
# include <stdio.h>
# include <sys/stat.h>
# include <pthread.h>
# include <fcgiapp.h>
const char* const sockpath = "/tmp/fcgicpp.sock";
#!/bin/bash
#set persistence mode for all GPU
sudo nvidia-smi -pm 1
#Set gpu max power at 160w
sudo nvidia-smi -pl 160
#Set Power level of specific GPU (1080) in watts
# sudo nvidia-smi -i 2 -pl 200
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}