Skip to content

Instantly share code, notes, and snippets.

View danielmascena's full-sized avatar
🎯
Focusing

Daniel Mascena danielmascena

🎯
Focusing
View GitHub Profile
@joakimbeng
joakimbeng / router.html
Last active March 15, 2024 06:18
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:
@siggiarni
siggiarni / nth-last-child.css
Last active October 1, 2021 22:45
Style a penultimate child in CSS thanks to the power of nth-last-child:
ul li:nth-last-child(2) {
...
}
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@jctosta
jctosta / linux_cheatsheet.md
Last active October 21, 2021 20:50
Linux - Comandos úteis

Linux - Comandos Úteis

  • O comando abaixo força o git a sempre utilizar o protocolo https em seus downloads:
    • git config --global url."https://".insteadOf git://
  • Configuração de Proxy no GIT:
    • git config --global http.proxy http://proxyuser:proxypass@prxrj.prevnet:8080
    • git config --global https.proxy http://proxyuser:proxypass@prxrj.prevnet:8080
  • Liberar autenticação do proxy em ambientes sem interface gráfica (Resolve o problema do erro 407 ao realizar requisições):
    • curl -v -U proxyuser:proxypass -x http://prxrj.prevnet:8080 --url http://www.google.com --proxy-ntlm
  • Matar todos os processos Zumbi:
@jctosta
jctosta / check_location.js
Created August 6, 2014 17:31
Check Machine Location
#!/usr/bin/env node
var args = process.argv.slice(2);
//console.log('Started');
// String startsWith polyfill
if (!String.prototype.startsWith) {
Object.defineProperty(String.prototype, 'startsWith', {
enumerable: false,
@learncodeacademy
learncodeacademy / generators.md
Last active January 7, 2024 11:58
What are Javascript Generators?

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@magicznyleszek
magicznyleszek / css-selectors.md
Last active March 29, 2024 01:12
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
@jcgregorio
jcgregorio / How_to_use.html
Last active July 17, 2023 14:44
HTML Templating using the HTML <template> element and exactly 100 lines of JS. A cleaned up version of this code is now available at https://github.com/jcgregorio/stamp/.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="templating.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<template id=t>
@colintoh
colintoh / table.css
Created October 27, 2014 05:42
Table CSS
table { display: table }
tr { display: table-row }
thead { display: table-header-group }
tbody { display: table-row-group }
tfoot { display: table-footer-group }
col { display: table-column }
colgroup { display: table-column-group }
td, th { display: table-cell }
caption { display: table-caption }