Skip to content

Instantly share code, notes, and snippets.

View jfrux's full-sized avatar
👨‍💻
Full send daily.

jfrux jfrux

👨‍💻
Full send daily.
View GitHub Profile
@bibendi
bibendi / .pryrc
Last active December 5, 2023 12:52
Dip on Rails
Pry.config.history.should_save = true
Pry.config.history.file = File.join(__dir__, '.pry_history')
@Startouf
Startouf / gist:91d3b5eab004f04dfbb0d068b311ff3e
Created February 9, 2018 17:29
Mongoid adapter for jsonapi_suite
# lib/jsonapi/adapters/transactionless_mongoid_adapter.rb
module Jsonapi
module Adapters
# Mongoid transactionless adapter
# See https://github.com/jsonapi-suite/jsonapi_compliable/blob/master/lib/jsonapi_compliable/adapters/abstract.rb
#
# @author [Cyril]
#
class TransactionlessMongoidAdapter < JsonapiCompliable::Adapters::Abstract
def sideloading_module
@enamhasan
enamhasan / order-template.liquid
Created March 23, 2016 11:12
Shopify Order Printer Template with product image, variations and line item properties
<p style="float: right; text-align: right; margin: 0;">
{{ "now" | date: "%m/%d/%y" }}<br />
Invoice for {{ order_name }}
</p>
<div style="float: left; margin: 0 0 1.5em 0;" >
<strong style="font-size: 2em;">{{ shop_name }}</strong><br /><br />
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}
@thecatmelon
thecatmelon / BarcodeJS.md
Created June 10, 2015 15:16
Barcode JS: Shopify Order Printer App - believe in your dreams.

#Barcode JS: Shopify Order Printer App

This is a javascript solution to have Shopify's Order Printer app display product variant barcodes in the following formats:

Below is a screenshot of a basic template using this barcode solution:

@roryl
roryl / javahttp.cfm
Created September 27, 2013 13:58
Make a request in Java instead of CFHTTP to resolve SNI issues
<cfscript>
myUrl = "https://news.google.com/news?gl=us&hl=en&as_epq=chinese+medicine&as_occt=title&as_qdr=a&authuser=0&q=allintitle:++%22chinese+medicine%22&um=1&output=rss"; // web service url
objUrl = createobject("java","java.net.URL").init(myUrl);
conn = objUrl.openConnection();
//configure the request
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setRequestMethod("GET");
@nathancolgate
nathancolgate / Gemfile
Last active January 31, 2023 01:44
How I built a rails interface on top of the amazing IceCube ruby gem. Video of final product: http://youtu.be/F6t-USuWPag
# Add these two gems
gem 'ice_cube', '0.9.3'
gem 'squeel', '1.0.16'
@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@stefanobernardi
stefanobernardi / application_controller.rb
Created September 23, 2012 07:07
Multiple omniauth providers and omniauth-identity on the main user model
class ApplicationController < ActionController::Base
protect_from_forgery
protected
def current_user
@current_user ||= User.find_by_id(session[:user_id])
end
def signed_in?
@venj
venj / com.yourcompany.autossh.plist
Created May 30, 2012 14:39
Put following gist to ~/Library/LaunchAgents, and then run: launchctl load /Users/your_name/Library/LaunchAgents/com.yourcompany.autossh.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OnDemand</key>
<false/>
<key>KeepAlive</key>
<true/>
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->