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
View GitHub Profile
@laphilosophia
laphilosophia / ratingStar.css
Last active February 29, 2016 13:16
Ratings Stars
/*
Ratings Stars
(with as little code as possible)
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
}
.rating > span {
.colors {
background-color: #153e78;
}
var gulp = require('gulp');
var browserify = require('browserify');
var notify = require('gulp-notify');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var plumber = require('gulp-plumber');
var less = require('gulp-less');
var csso = require('gulp-csso');
var watch = require('gulp-watch');
var envify = require('envify');
.copySuccess,
.copyError {
width: 300px;
height: 75px;
display: none;
padding: 0;
margin: auto;
position: fixed;
@laphilosophia
laphilosophia / detectandroidversion.js
Created June 23, 2016 16:11
Detect android version with javascript.
function getAndroidVersion(ua) {
ua = (ua || navigator.userAgent).toLowerCase();
var match = ua.match(/android\s([0-9\.]*)/);
return match ? match[1] : false;
};
var androidVersion = parseFloat(getAndroidVersion());
if (androidVersion === 4.4) {
// ..
}
@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;
@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')
<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>
var evts = (function () {
'use strict';
var listeners = [],
add,
remove;
add = function (evt, elem, fn) {
var callback = function (evt) {
fn(evt.target);
(function() {
'use strict';
var app = (function() {
var modules = [];
var init = function() {
fonts;
};