Skip to content

Instantly share code, notes, and snippets.

View andreibosco's full-sized avatar

Andrei Bosco B. Torres andreibosco

View GitHub Profile
@andreibosco
andreibosco / FadeInOut.cs
Created February 5, 2022 15:59 — forked from NovaSurfer/FadeInOut.cs
Unity3D screen fading script (using new UI)
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.SceneManagement;
public class ScreenFader : MonoBehaviour
{
public Image FadeImg;
public float fadeSpeed = 1.5f;
public bool sceneStarting = true;
@andreibosco
andreibosco / decorators.py
Created July 29, 2021 17:32 — forked from canokay/decorators.py
Django Custom View Decorators
from django.http import HttpResponseRedirect
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.shortcuts import render
from django.shortcuts import redirect
def role_required(allowed_roles=[]):
def decorator(view_func):
def wrap(request, *args, **kwargs):
@andreibosco
andreibosco / bookmark.min.js
Created July 14, 2020 16:36 — forked from zaydek-old/bookmark.min.js
A *simple* CSS debugger. To use, bookmark "Debug CSS" at https://zaydek.github.io/debug.css. Learn more here https://medium.freecodecamp.org/88529aa5a6a3 and https://youtu.be/2QdzahteCCs?t=1m25s (starts at 1:25)
/* debug.css | MIT License | zaydek.github.com/debug.css */ if (!("is_debugging" in window)) { is_debugging = false; var debug_el = document.createElement("style"); debug_el.append(document.createTextNode(`*:not(g):not(path) { color: hsla(210, 100%, 100%, 0.9) !important; background: hsla(210, 100%, 50%, 0.5) !important; outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; box-shadow: none !important; filter: none !important; }`)); } function enable_debugger() { if (!is_debugging) { document.head.appendChild(debug_el); is_debugging = true; } } function disable_debugger() { if (is_debugging) { document.head.removeChild(debug_el); is_debugging = false; } } !is_debugging ? enable_debugger() : disable_debugger();
@andreibosco
andreibosco / git_submodules.md
Created February 16, 2017 15:53 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@andreibosco
andreibosco / install-mongodb.md
Created November 15, 2016 22:21 — forked from adamgibbons/install-mongodb.md
Install MongoDB on Mac OS X 10.9

Install MongoDB with Homebrew

brew install mongodb
mkdir -p /data/db

Set permissions for the data directory

Ensure that user account running mongod has correct permissions for the directory:

@andreibosco
andreibosco / index.html
Created January 12, 2016 05:45 — forked from 1forh/index.html
Prevent map zoom on scroll
<div id="map_wrapper">
<iframe id="map_canvas"></iframe>
</div>
@andreibosco
andreibosco / tmux-cheatsheet.markdown
Created November 1, 2015 21:45 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
<html>
<body>
<section class="left">
<article id="customers">
<h2>New Customers</h2>
<table class="data">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>

Fonte: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx

  • Convert the .iso file to .img using the convert option of hdiutil: hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso
  • Run diskutil list to get the current list of devices.
  • Insert your flash media.
  • Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2).
  • Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2).
  • Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.imgor ./ubuntu.dmg).
    • Using /dev/rdisk instead of /dev/disk may be faster
  • Run diskutil eject /dev/diskN and remove your flash media when the command completes