Skip to content

Instantly share code, notes, and snippets.

View milose's full-sized avatar

Miloš Šaković milose

View GitHub Profile

Javascript30 Start-up Tools

Install Atom editor

Download

Install XCode Command Tools

xcode-select --install

Goals

Hardware

Software

In Action

@milose
milose / apache-caching.md
Last active March 24, 2016 14:00
Leverage Browser Caching for Static Files with .htaccess

This is what I use to control headers/caching, I'm not an Apache pro, so let me know if there is room for improvement, but I know that this has been working well on all of my sites for some time now.

mod_expires

http://httpd.apache.org/docs/2.2/mod/mod_expires.html

This module controls the setting of the Expires HTTP header and the max-age directive of the Cache-Control HTTP header in server responses. The expiration date can set to be relative to either the time the source file was last modified, or to the time of the client access.

These HTTP headers are an instruction to the client about the document's validity and persistence. If cached, the document may be fetched from the cache rather than from the source until this time has passed. After that, the cache copy is considered "expired" and invalid, and a new copy must be obtained from the source.

# BEGIN Expires
@milose
milose / ESP8266.md
Last active February 19, 2016 19:00
ESP8266 notes

ESP8266-01 Pinout

ESP8266-01 Pinout

Programming (firmware upload) hookup

ESP8266-01

  • VCC -> Power supply VCC (3V3!)
  • CH_PD -> Power supply VCC (3V3!)
  • GND -> Common GND
  • GPIO_00 -> Common GND
@milose
milose / gistlog.yml
Last active February 19, 2016 18:59
Persisting MySQL data with Homestead destroy
published: false
@milose
milose / forever.md
Last active January 17, 2023 06:36
Making your node apps run on startup and forever

Hello forever

Forever is a simple CLI tool for ensuring that a given script runs continuously (i.e. forever). Install it globally using NPM:

$ [sudo] npm install forever -g

Create a forever.json for your apps

This file should contain settings for all of your apps you want to run at boot. I use /var/www/nodes to store my node apps and I put my forever.json to /var/www/nodes/forever.json.

[
@milose
milose / create-users-mysql.md
Last active December 3, 2016 17:02
MySQL user queries

Quick snippets

User info

Show all users and hosts

SELECT User, Host FROM mysql.user;

Show grants for logged in user

SHOW GRANTS;
@milose
milose / gulpfile.js
Last active December 17, 2015 04:57
Laravel gulpfile.js with Foundation
// load elixir and .env reader
var elixir = require('laravel-elixir'),
env = require('dotenv').load();
// plug-ins
require('laravel-elixir-vueify');
// paths
var path = {
node: 'node_modules/',
@milose
milose / array-filters.js
Last active December 16, 2015 18:15
orderByCi case insensitive order by for vue.js
export function orderByCi (arr, sortKey, reverse) {
arr = convertArray(arr)
if (!sortKey) {
return arr
}
arr = arr.map(function (item) {
return item.toUppercase();
});
return orderBy(arr, sortKey, reverse);
@milose
milose / linux-sound.md
Last active December 15, 2015 05:45
Sound settings on debian

Mixer

sudo  alsamixer

Sound settings

sudo nano /etc/asound.conf