Skip to content

Instantly share code, notes, and snippets.

View Khangeldy's full-sized avatar
🌄
Kettim baska jaka

Khangeldy Khangeldy

🌄
Kettim baska jaka
  • Kazakhstan, Almaty
View GitHub Profile
@Khangeldy
Khangeldy / rand-color.js
Created January 3, 2018 12:57
Get random color in hex
function randomColor() {
return('#' + Math.floor(Math.random() * 16777215).toString(16));
}
Function.prototype.debounce = function (delay) {
var func = this,
timeout;
return function debounced() {
var obj = this,
args = arguments;
function delayed () {
func.apply(obj, args);
import {
GraphQLNonNull,
GraphQLObjectType,
GraphQLInt,
GraphQLString,
GraphQLID,
} from 'graphql';
import { mutationWithClientMutationId, fromGlobalId } from 'graphql-relay';
import validator from 'validator';
import db from '../../db';
@Khangeldy
Khangeldy / after-reset.css
Created August 12, 2017 21:28
after reset
*, *:after, *:before {
box-sizing: border-box;
}
a {
color: inherit;
text-decoration: none;
}
ul {
@Khangeldy
Khangeldy / package.json
Last active August 12, 2017 21:22
Postcss webpack simple
{
"name": "Start it",
"version": "1.0.0",
"description": "project starter for static scaffolding",
"main": "dist/js/bundle.js",
"scripts": {
"start": "webpack --watch",
"build": "webpack",
"build:prod": "webpack -p --config webpack.config.prod.js",
"watch": "webpack --progress --watch",
@Khangeldy
Khangeldy / webpack.config.js
Created October 21, 2016 09:54 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@Khangeldy
Khangeldy / npm start script
Last active October 29, 2016 07:48
Sass, babel, uglify, imagemin builder
{
"name": "npm-config",
"version": "1.0.0",
"description": "task with pure node",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build-css": "node-sass src/css/style.scss dist/css/style.css",
"build-js": "babel --presets babel-preset-es2015 dist/js/app.js -d dist/js/",
"minify-js": "uglifyjs dist/js/app.js -o dist/js/app.min.js",
/*---------------------------------*
* MEDIA BREAKPOINTS
/*---------------------------------*/
small = 768px
tablet = 992px
desktop = 1200px
/*---------------------------------*
* MEDIA SHORTCUT
/*---------------------------------*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@Khangeldy
Khangeldy / _mixins.scss
Last active January 25, 2017 06:35
Sass
// Box Model
// ==========================================================================
@mixin border-box {
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}