Skip to content

Instantly share code, notes, and snippets.

View georgebrata's full-sized avatar
👨‍💻
{writing|reading} quality code

George Brata georgebrata

👨‍💻
{writing|reading} quality code
View GitHub Profile
@georgebrata
georgebrata / gist:8c44a3315f02cb850c97
Created March 28, 2016 07:29
.btn class - Meatballs
.btn {
display: block;
height: 50px;
width: 200px;
text-align: center;
margin: 150px 20px 10px 20px;
vertical-align: middle;
padding: 10px;
text-transform: uppercase;
<add key="formTitle" value="Categories"/>
<add key="masterTable" value="Product_Categories"/>
<add key="detailTable" value="Products"/>
<add key="foreignkey" value="product_category_code"/>
@georgebrata
georgebrata / index.html
Created May 30, 2016 08:45
Vanilla Javascript Spintax Function
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Spintax Spinner</title>
</head>
<body>
<script>
var SPINTAX_PATTERN = /\{[^"\r\n\}]*\}/;
var spin = function (spun) {
@georgebrata
georgebrata / .js
Created March 3, 2017 10:09
Angular HTTP Service
'use strict';
//ToasterService Dependency
app.factory('HttpService', ['$q', '$http', 'ToastrService', function ($q, $http, ToastrService) {
var HTTP_STATUS_CODES = {
BAD_REQUEST: 400,
NOT_FOUND: 404
};
var request = function (method, url, data) {
var deferred = $q.defer();
@georgebrata
georgebrata / registerServiceWorker.js
Created July 25, 2018 10:59
registerServiceWorker.js
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
@georgebrata
georgebrata / graphql-example.js
Created November 22, 2018 19:59
Simple GraphQL example using express-graphql
var express = require('express');
var graphqlHTTP = require('express-graphql');
var { buildSchema } = require('graphql');
// Construct a schema, using GraphQL schema language
var schema = buildSchema(`
type Query {
quoteOfTheDay: String
random: Float!
rollThreeDice: [Int]
@georgebrata
georgebrata / fetch-example.js
Created November 22, 2018 20:01
POST request example using fetch
let URL = "https://example.com/api";
fetch(URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({query: "{ hello }"})
})
@georgebrata
georgebrata / tooltip.scss
Created November 27, 2018 16:51
Tooltip experimental SCSS
[class*=ng-tooltip--] {
position: relative;
display: inline-block;
cursor: pointer;
}
[class*=ng-tooltip--]:after, [class*=ng-tooltip--]:before {
position: absolute;
-webkit-transform: translate3d(0,0,0);
-moz-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
@georgebrata
georgebrata / instagram-superpowers.js
Last active February 2, 2019 21:44
A simple JS script that lets you browse Instagram at the speed of light 💫
// Author: George Brata
// Based on "Simple Instagram Like Bot" by JoelDare
// https://www.joeldare.com/wiki/simple_instagram_like_bot
// INSTRUCTIONS:
// Make sure you are on the Instagram Paginated Like-Page - it looks like this: https://imgur.com/a/KB174
// Open Developer Tools Console and paste this entire script
//--------
// Now Press:
@georgebrata
georgebrata / thermometer-index.html
Created April 5, 2019 07:45
A simple thermometer made only with CSS. Production-ready 📄
<!DOCTYPE html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>CSS-only thermometer</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon" href="apple-touch-icon.png" />