Skip to content

Instantly share code, notes, and snippets.

View Thivieira's full-sized avatar

Thiago Vieira Thivieira

View GitHub Profile
anonymous
anonymous / config.json
Created December 20, 2016 15:43
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@Thivieira
Thivieira / config.json
Last active December 20, 2016 15:44 — forked from anonymous/config.json
Bootstrap Customizer Config (SKELETON TABLE)
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",

Auth

Not Web Security...


Auth Basics

We check passwords against the records in our database.

Authentication – Is this person who they say they are?

How do people stay logged in?

@robotmay
robotmay / Distance search in SQL
Created March 2, 2011 16:55
SQL query to search based on latitude, longitude, and a distance in miles from a location
# Using an example table of 'addresses' with a latitude and longitude column
# Replace #LONGITUDE#, #LATITUDE#, and #DISTANCE_IN_MILES# with your search values
SELECT addresses.*, (ACOS( SIN(RADIANS(#LATITUDE#)) * SIN(RADIANS(addresses.latitude)) + COS(RADIANS(#LATITUDE#)) * COS(RADIANS(addresses.latitude)) * COS(RADIANS(addresses.longitude) - RADIANS(#LONGITUDE#)) ) * 3963.1676) AS distance
FROM addresses
WHERE (((ACOS( SIN(RADIANS(#LATITUDE#)) * SIN(RADIANS(addresses.latitude)) + COS(RADIANS(#LATITUDE#)) * COS(RADIANS(addresses.latitude)) * COS(RADIANS(addresses.longitude) - RADIANS(#LONGITUDE#)) ) * 3963.1676) <= #DISTANCE#) OR (addresses.latitude = #LATITUDE# AND addresses.longitude = #LONGITUDE#))
@cereallarceny
cereallarceny / index.js
Created October 12, 2017 20:37
Server-side rendering with create-react-app (Fiber), React Router v4, Helmet, Redux, and Thunk
// Ignore those pesky styles
require('ignore-styles');
// Set up babel to do its thing... env for the latest toys, react-app for CRA
require('babel-register')({
ignore: /\/(build|node_modules)\//,
presets: ['env', 'react-app']
});
// Now that the nonsense is over... load up the server entry point
@Atinux
Atinux / index.vue
Created July 4, 2017 10:25
Dynamic image nuxt
<template>
<div>
<h1>Welcome!</h1>
<nuxt-link to="/about">About page</nuxt-link>
<img :src="flagUrl"/>
<button @click="nextFlag">Next flag</button>
</div>
</template>
<script>
@retlehs
retlehs / gist:e5683cb8377e1b1836ab
Created May 26, 2015 16:26
Don't be scared of Sage

This is from a comment on the Advanced WordPress Facebook group by Kevin Hoffman.


Disclaimer: I'm not affiliated with Roots, just a satisfied user.

In response to several recent questions on the topic of starter themes, the following are my thoughts on what I believe is the best starter theme available today, along with a heads-up on an upcoming resource that may help you in the near future.

Recommendations for starter themes come up quite often in AWP, and my first instinct is to recommend Roots' Sage starter theme (https://roots.io/sage/), but to be honest, it's not for everyone. I feel like I always have to attach the caveat concerning the prerequisites: Node.js, gulp, Bower, CSS preprocessing, build processes, etc. I often see advanced devs discouraging others from trying Sage if they're not 100% up to date on all of these tools. Don't let that scare you.

{
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.formatOnPaste": true,
"editor.fontFamily" : "Fira Code",
"editor.fontLigatures": true,
"emmet.triggerExpansionOnTab": true,
"php.suggest.basic": false,
"editor.autoIndent": true,
"emmet.includeLanguages" : {
@edheltzel
edheltzel / php-server-with-wordpress.md
Last active November 26, 2020 21:33
Using PHP's built in server for WordPress development.

Preface

So in the past, I've used MAMP/MAMP Pro apps and others alike. I've also, setup my own local MAMP stack with homebrew, that used dnsmasq to dynamically add vhosts anytime I added a new folder to the Sites folder which made it very convenient. But, then I started running into other environment issues with PHP versions on remote machines/servers not being updated or some other crazy thingamabob breaking. I researched and invested time in Vagrant, but that seem to break more often than my homebrew setup. So I researched again investing time into Docker via Docker for Mac (which is BAMF), which I'm sold on and use daily, but it still seems a little bleeding edge and not so simple to wrap your head around the concept. Not to mention I don't have a real use case to play with and take advantage of all the features that come packed with Docker.

This is the beginning of trying to find something more simple, and slightly quicker to setup.

@jonathantneal
jonathantneal / mimetypes.json
Created May 6, 2013 03:49
Mime Types JSON
{
"audio/mp4": "m4a|f4a|f4b",
"audio/ogg": "oga|ogg",
"audio/&": "mid|midi|mp3|wav",
"application/javascript": "js|jsonp",
"application/json": "json",
"application/msword": "doc|dot",
"application/octet-stream": "bin",
"application/postscript": "ai",
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",