Skip to content

Instantly share code, notes, and snippets.

View laphilosophia's full-sized avatar
🖖
Live long and prosper

Erdem Arslan laphilosophia

🖖
Live long and prosper
  • World
  • 09:37 (UTC +03:00)
View GitHub Profile
@laphilosophia
laphilosophia / MySQL_macOS_Sierra.md
Created April 2, 2018 08:51 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@laphilosophia
laphilosophia / vuex-state-reset.js
Last active February 27, 2018 06:35
vuex state reset
export const RESET_STATES = 'resetStates'
function resetState (state, moduleState) {
const mState = state[moduleState]
if (mState.initState && typeof mState.initState === 'function') {
const initState = mState.initState()
for (const key in initState) {
mState[key] = initState[key]
@laphilosophia
laphilosophia / content_editable.js
Created January 30, 2018 11:14 — forked from rafaelsq/content_editable.js
Vue ContentEditable
export default {
name: 'content_editable',
template: '<div ref="element" v-html="text"></div>',
props: {
text: [String],
customTag: [String],
},
mounted: function() {
let newElement = document.createElement(this.customTag || 'div')
@laphilosophia
laphilosophia / tips.js
Created October 30, 2017 10:35
Performance Tips.
// Browser loading time
let calc = () => {
const domint = window.performance.timing.domInteractive;
const reqstr = window.performance.timing.requestStart;
return domint - reqstr;
}
// Resource timing
let perf = () => {
return window.performance.getEntriesByType('resource') || [];
@laphilosophia
laphilosophia / sass-icon-list.scss
Last active October 26, 2017 14:53
Sass each sample
@mixin size($width, $height: $width) {
width: $width;
height: $height;
}
@mixin display($display, $align: false) {
display: $display;
@if $align {
vertical-align: $align;
}
(function() {
'use strict';
var app = (function() {
var modules = [];
var init = function() {
fonts;
};
var evts = (function () {
'use strict';
var listeners = [],
add,
remove;
add = function (evt, elem, fn) {
var callback = function (evt) {
fn(evt.target);
<div id="wrapper"></div>
<input type="text" id="input" placeholder="Değeri Gir"><!--
--><button id="convert" onClick="convert()">Dönüştür</button>
<p id="output"></p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
@laphilosophia
laphilosophia / asyncawaitreact.jsx
Created December 29, 2016 19:19
Async Await with React Lifecycle methods
class AwesomeProject extends Component {
state = {}
setStateAsync(state) {
return new Promise((resolve) => {
this.setState(state, resolve)
});
}
async componentDidMount() {
StatusBar.setNetworkActivityIndicatorVisible(true)
const res = await fetch('https://api.ipify.org?format=json')
@laphilosophia
laphilosophia / _gradient.scss
Created September 30, 2016 10:42
scss gradient mixin
/// Mixin printing a linear-gradient
/// as well as a plain color fallback
/// and the `-webkit-` prefixed declaration
/// @access public
/// @param {Keyword | Angle} $direction - Linear gradient direction
/// @param {Arglist} $color-stops - List of color-stops composing the gradient
@mixin linear-gradient($direction, $color-stops...) {
// Direction has been omitted and happens to be a color-stop
@if is-direction($direction) == false {
$color-stops: $direction, $color-stops;