Skip to content

Instantly share code, notes, and snippets.

@ifnull
ifnull / git-reset-develop.sh
Created June 23, 2016 22:37
Git refresh develop from master
# Delete your local develop
git checkout master
git branch -D develop
# Recreate your local develop, based on origin's master
git pull origin master
git checkout -b develop
# Push and overwrite the sloppy develop on the origin
git push origin develop --force
@ifnull
ifnull / index.js
Last active June 21, 2016 00:28
Omniture Measurement Library for Node - Experimental port from official PHP package.
'use strict';
const OmnitureMeasurement = require('./omniture-measurement');
const account = 'tar***************************';
const trackingServer = 'metrics.*****.com';
// Use the chatId from kik
var visitorId = 'b3be3bc15dbe59931***********************0afab';
@ifnull
ifnull / foobar.com.conf
Created May 4, 2016 00:56
NGINX IP Whitelist Facebook
server {
listen 80;
server_name foobar.com ;
access_log /srv/www/foobar.com/logs/access.log;
error_log /srv/www/foobar.com/logs/error.log;
root /srv/www/foobar.com/current/web;
index index.php index.htm index.html;
# Example Meta
my_order = shopify.Order().find(2559147783)
meta_test = shopify.Metafield()
meta_test.namespace = "'fulfillment"
meta_test.key = "hold"
meta_test.value = "active"
meta_test.value_type = "string"
my_order.add_metafield(meta_test)
# Example Fulfillment
@ifnull
ifnull / alphabet_matrix.py
Last active February 6, 2016 20:51
Print letters from a matrix in a spiral direction inward.
"""Alphabet Matrix.
Usage:
alphabet_matrix.py
Options:
-h --help Show this screen.
--version Show version.
"""
import string
def plist_request(host, method, url, body, headers):
conn = HTTPSConnection(host)
sock = socket.create_connection((conn.host, conn.port), conn.timeout, conn.source_address)
conn.sock = ssl.wrap_socket(sock, conn.key_file, conn.cert_file, ssl_version=ssl.PROTOCOL_TLSv1)
request = conn.request(method, url, body, headers)
response = conn.getresponse()
data = response.read()
print data
try:
@ifnull
ifnull / README.sh
Created November 21, 2015 04:21
Cleanup recovered Git repo
# Remove ".txt" extension from filename recursively
find . -name "*.txt" -exec rename -v 's/\.txt$//i' {} \;
# Delete all ".html" files
find . -name "*.html" -type f -delete
@ifnull
ifnull / README.md
Last active October 7, 2015 20:57
Shopify Paypal Order IDs in wrong format.

Shopify Paypal Order IDs in wrong format.

Below is an excerpt from an email response another customer received regarding the matter. According to Shopify they changed the Order ID to a Checkout ID to resolve a preformance and order of operations issue. What is in Paypal is the Checkout ID. The number is searchable in Shopify and a portion of this number appears in the order details.

There was a change in how the checkout process works in order to optimize the process and handle larger volumes of traffic without any issues or downtime. Part of this change was how checkouts are numbered. Prior to the change as soon as a customer started the checkout process an OrderID was generated, we’ve since switched the process to include a checkout ID during the checkout process where a customer enters their payment information, this checkout ID is what your seeing. The order number is now generated once a customer successful pays and generates a proper order.

>The workflow for an order creation looks a bit like this:

@ifnull
ifnull / Crack-Master-Combo-Locks.html
Created July 31, 2015 17:04
Crack Master Combo Locks in 8 Tries - samy kamkar
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<title>Crack Master Combo Locks in 8 Tries - samy kamkar</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
@ifnull
ifnull / test.php
Created June 22, 2015 21:54
PHP search Netsuite for accounting period or posting period
<?php
// Get Accounting Period for specific month
// Start Date is on 6/1/2015
// End Date is on 6/30/2015
// Quarter is false
require_once '../PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();