Skip to content

Instantly share code, notes, and snippets.

View sagerio's full-sized avatar

sager.io sagerio

View GitHub Profile
@sagerio
sagerio / random.ts
Created December 27, 2017 23:16
Javascript Random Numbers
function randomIntFromInterval(min,max)
{
return Math.floor(Math.random()*(max-min+1)+min);
}
@sagerio
sagerio / git-commands.md
Last active May 17, 2024 18:28
Git commands

FORCE REMOTE BRANCH TO LOCAL BRANCH

$ git reset --hard origin/master

UPDATE GIT (WINDOWS)

$ git update-git-for-windows

CONFIG

$ git config --list --show-origin

LINE ENDING SETTINGS

@sagerio
sagerio / angular-form.html
Last active March 2, 2021 11:11
Angular form Example
<div class="container border border-danger">
<form #maria="ngForm">
<input type="text"
class="form-control"
required
[(ngModel)]="test"
name="firstName"
#first="ngModel"
minlength="3"
<div *ngIf="(user$ | async) as user; else loading">
<user-profile
[user]="user.profile">
</user-profile>
<user-messages
[user]="user.messages">
</user-messages>
</div>
<div style="text-align: center;">
  <div style="display: inline-block; text-align: left;">
    Centered<br />
    Content<br />
    That<br />
    Is<br />
    Left<br />
    Aligned
 
@sagerio
sagerio / gist:9785ca47e9d252f0ef7537fdd5f6ce77
Created June 3, 2019 11:23 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@sagerio
sagerio / git-deployment.md
Created November 20, 2019 13:48 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@sagerio
sagerio / git-pushing-multiple.rst
Created November 27, 2019 19:26 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@sagerio
sagerio / tmux-cheatsheet.markdown
Created February 4, 2020 07:34 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
.class .intro Selects all elements with class="intro"
.class1.class2 .name1.name2 Selects all elements with both name1 and name2 set within its class attribute
.class1 .class2 .name1 .name2 Selects all elements with name2 that is a descendant of an element with name1
#id #firstname Selects the element with id="firstname"
* * Selects all elements
element p Selects all <p> elements
element.class p.intro Selects all <p> elements with class="intro"
element,element div, p Selects all <div> elements and all <p> elements
element element div p Selects all <p> elements inside <div> elements
element>element div > p Selects all <p> elements where the parent is a <div> element