Skip to content

Instantly share code, notes, and snippets.

View mugetsu's full-sized avatar
♥️

Randell Quitain mugetsu

♥️
View GitHub Profile
@mugetsu
mugetsu / playground.swift
Created October 8, 2022 18:09 — forked from ftp27/playground.swift
AutoLayout Hugging Priority and Compression Resistance Priority tests
import PlaygroundSupport
import UIKit
func makeLabels(left: String, right: String) -> (UIView, UILabel, UILabel) {
let leftLb: UILabel = {
let label = UILabel(frame: .zero)
label.textAlignment = .left
label.backgroundColor = .blue
label.text = left
return label
@mugetsu
mugetsu / stacks-queues
Created March 18, 2020 04:33
Stack vs Queue
// Last-In, First-Out
var stack = [];
stack.push(2); // stack is now [2]
stack.push(5); // stack is now [2, 5]
var i = stack.pop(); // stack is now [2]
alert(i); // displays 5
// First-In First-Out
var queue = [];
queue.push(2); // queue is now [2]
@mugetsu
mugetsu / group-by
Created March 14, 2020 10:46
Group object by key
// Accepts the array and key
const groupBy = (array, key) => {
// Return the end result
return array.reduce((result, currentValue) => {
// If an array already present for key, push it to the array. Else create an array and push the object
(result[currentValue[key]] = result[currentValue[key]] || []).push(
currentValue
);
// Return the current iteration `result` value, this will be taken as next iteration `result` value and accumulate
return result;
@mugetsu
mugetsu / flexbox.scss
Created October 15, 2018 07:33 — forked from richardtorres314/flexbox.scss
CSS Flexbox - Sass Mixins
// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
@mugetsu
mugetsu / index.html
Created May 25, 2018 10:15
Vue + Firebase To Do
<div id="root">
<h2>Add New Task</h2>
<div class="todo-new">
<div class="todo-new__item">
<input type="text"
placeholder="Feeling productive?"
v-model="task" />
<button @click="addTask()">Just do it!</button>
</div>
</div>
@mugetsu
mugetsu / css-media-queries-cheat-sheet.css
Created February 5, 2018 10:33 — 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) { }
@mugetsu
mugetsu / bst.js
Created August 28, 2017 16:46 — forked from agborkowski/bst.js
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*
@mugetsu
mugetsu / Sublime Text 3 Build 3103 License Key - CRACK
Created July 21, 2017 07:02
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@mugetsu
mugetsu / gist:2f8fbcdb67f21b07621fd5f61b3c9534
Created June 22, 2017 06:40 — forked from stuart11n/gist:9628955
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