Skip to content

Instantly share code, notes, and snippets.

@jatazoulja
jatazoulja / test.ipl
Created October 9, 2019 00:15
testing ipl printing language for barcode printers
<STX><ESC>C0<ETX>
<STX><ESC>P<ETX>
<STX>E4;F4,DEMO 4<ETX>
<STX>L1;o11,447;f0;l1207;w4<ETX>
<STX>L2;o11,285;f0;l1207;w4<ETX>
<STX>W3;o11,0;f0;l1207;h802;w4<ETX>
<STX>B4;o658,650;f0;h102;w2;c0,0;i1;r1;d0,11<ETX>
<STX>I4;o658,752;f0;h1;w1;c20;r0;b0<ETX>
<STX>B5;o87,650;f0;h102;w2;c0,0;i1;r1;d0,11<ETX>
<STX>I5;o87,752;f0;h1;w1;c20;r0;b0<ETX>
@jatazoulja
jatazoulja / App.js
Last active August 2, 2018 00:17
serverless-client withConntext
import React, { Component } from "react";
import { Auth } from "aws-amplify";
import { Link, withRouter } from "react-router-dom";
import Routes from "./Routes";
import Typography from "@material-ui/core/Typography";
import MainDrawer from "./components/MainDrawer";
import "./App.css";
import Header from "./components/Header";
import ContextProvider from "./Packages/Context/";
import UIToggleProvider from "./Packages/Context/UIToggleContext";
@jatazoulja
jatazoulja / AuthContext.js
Created August 1, 2018 01:00
Context with HoC for consumer.
import React, { createContext, Component } from "react";
import { Auth } from "aws-amplify";
const AuthContext = createContext({
isAuthenticated: false,
isAuthenticating: true
});
class AuthProvider extends Component {
state = {
isAuthenticated: false,
@jatazoulja
jatazoulja / facebook-aws-cognito-userpool
Last active February 12, 2018 07:32
NOTE: this uses AWS USER POOL custom UI. Please configure your user pool first.
/**
* NOTE: this uses aws USER POOL custom UI.
* Please configure your user pool first.
*/
export async function facebookOAuth2() {
return new Promise((resolve, reject) => {
let authHost = 'https://<sub domain>.auth.ap-southeast-1.amazoncognito.com';
let identityProvider = 'Facebook';
let redirectUri = 'http://localhost:3000/oauth/';
@jatazoulja
jatazoulja / gist:d8d563f736a44414cbdcc3998c0c6de8
Created January 21, 2018 06:18 — forked from voskobovich/gist:537b2000108e4781f70b
List of most currency ISO code and symbol format in SQL.
DROP TABLE currency;
-- Create table variable
CREATE TABLE currency (
name VARCHAR(100),
code VARCHAR(100),
symbol VARCHAR(100)
);
-- Insert currency records
export function success(body) {
return buildResponse(200, body);
}
export function failure(body) {
return buildResponse(500, body);
}
function buildResponse(statusCode, body) {
return {
@jatazoulja
jatazoulja / htmlminify_htmlminify.iml
Created June 24, 2014 04:22
HTML minifier that includes tpl files.
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />