Skip to content

Instantly share code, notes, and snippets.

View pastranastevenaz's full-sized avatar
🎯
Focusing

Steven Antonio pastranastevenaz

🎯
Focusing
View GitHub Profile
@pastranastevenaz
pastranastevenaz / .htacces
Created September 2, 2017 15:48
htacces to remove index.html
RewriteEngine On
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
@pastranastevenaz
pastranastevenaz / axiosget.js
Created September 2, 2017 16:34
Example of an axios get request using arrow functions
var albums = [];
axios.get('https://jsonplaceholder.typicode.com/albums')
.then(response =>{
this.albums = response.data
})
.catch(error =>{
console.log(error);
})
@pastranastevenaz
pastranastevenaz / index.html
Created September 3, 2017 18:36
An html boilerplate which imports Bootstrap, Josefin Sans font, and JQuery
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>TITLE</title>
<meta name="author" content="name">
<meta name="description" content="description here">
<meta name="keywords" content="keywords,here">
@pastranastevenaz
pastranastevenaz / simplearg.py
Last active September 9, 2018 19:53
simple argparse example. Used to parse arguments in a comand line application written in Python
# simplearg.py
import argparse
# Create a parser object
parser = argparse.ArgumentParser(description="this is optional")
# add an argument using the parser object
parser.add_argument("name", help="Greeting")
# parse all arguments passed during the call
@pastranastevenaz
pastranastevenaz / fibarg.py
Created September 3, 2017 21:33
A python script to calculate the nthnumber in the Fibonacci series
import argparse
# The Fibonacci function
def fib(n):
a = 0
b = 1
for x in range(n):
a = b
b = a + b
return a
@pastranastevenaz
pastranastevenaz / start.sh
Last active October 25, 2017 04:33
script to start python environment
source dnsenv/dnsenv/bin/activate
cd app/
@pastranastevenaz
pastranastevenaz / makenormal.css
Created July 31, 2018 03:03
Baseline css rules to get rid of padding and margins, etc
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
@pastranastevenaz
pastranastevenaz / .htaccess
Last active August 9, 2018 07:02
htaccess notes
# Disable index view
Options -Indexes
# Hide a specific file | .env in this case #
<Files .env>
Order allow,deny
Deny from all
</Files>
@pastranastevenaz
pastranastevenaz / combobox.blade.php
Created August 9, 2018 10:00
Example using Laravel with a combobox that is automatically set to the index in the combobox based on a value from laravel's Auth::user()
<div class="form-group{{ $errors->has('state') ? ' has-error' : '' }}">
<label for="state" class="col-md-4 control-label">State</label>
<div class="col-md-6">
<select id="state" class="form-control" name="state" value="{{ Auth::user()->state }}" required autofocus>
<ul class="dropdown-menu" aria-labelledby="state">
<!-- ********************** -->
<!-- ** -->
<!-- ** This is Sedi's work right here <3 -->