Skip to content

Instantly share code, notes, and snippets.

View ozscosta's full-sized avatar
🌴
Developmeting

Ozeias Costa ozscosta

🌴
Developmeting
  • Codefuture
  • Palmas, BRA
View GitHub Profile
@ozscosta
ozscosta / commandline.txt
Last active August 30, 2018 21:41 — forked from sandervm/commandline.txt
Generate Django secret key commandline
python -c 'import random; result = "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]); print(result)'
Legacy Key | New Key | Comments
-------------------------------------|-------------------------------|---------
lxc.aa_profile | lxc.apparmor.profile |
lxc.aa_allow_incomplete | lxc.apparmor.allow_incomplete |
lxc.console | lxc.console.path |
lxc.devttydir | lxc.tty.dir |
lxc.haltsignal | lxc.signal.halt |
lxc.id_map | lxc.idmap |
lxc.init_cmd | lxc.init.cmd |
lxc.init_gid | lxc.init.gid |
@ozscosta
ozscosta / css-media-queries-cheat-sheet.css
Created September 26, 2018 02:51 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@ozscosta
ozscosta / clear-docker.sh
Last active December 30, 2022 00:27
[Clear docker data] Remove all docker data #docker #docker-prune
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker volume rm $(docker volume ls -qf dangling=true)
const temperaturas = {
'c': {
'f': (val) => (val * 1.8 + 32),
'k': (val) => (val + 273.15),
},
'f': {
'c': (val) => (val - 32) / 1.8,
'k': (val) => (val * 1.8) - 459.67,
},
'k': {
@ozscosta
ozscosta / git-update-fork.sh
Created April 17, 2019 00:24 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@ozscosta
ozscosta / snap-shorcuts.sh
Last active November 6, 2020 18:48
Enable desktop shortcuts from snapd apps
for i in /var/lib/snapd/desktop/applications/*.desktop; do
if [ ! -f ~/.local/share/applications/${i##*/} ];then
ln -s /var/lib/snapd/desktop/applications/${i##*/} ~/.local/share/applications/${i##*/};
fi;
done
@ozscosta
ozscosta / git-dmz-flow.md
Created August 14, 2019 21:02 — forked from djspiewak/git-dmz-flow.md
Git DMZ Flow

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
@ozscosta
ozscosta / HttpStatusCode.ts
Created October 1, 2020 23:27 — forked from scokmen/HttpStatusCode.ts
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@ozscosta
ozscosta / remove_adjacent.py
Created October 4, 2020 19:40
remove_adjacent.py
def remove_adjacent(nums):
if not nums:
return []
# return [nums[0]] + [n for c, n in zip(nums[:-1], nums[1:]) if c != n]
lista = [nums[0]]
for current, next_ in zip(nums[:-1], nums[1:]):
if current != next_: