Skip to content

Instantly share code, notes, and snippets.

View mfyz's full-sized avatar
✌️

Fatih Felix Yildiz mfyz

✌️
View GitHub Profile
@mfyz
mfyz / index.html
Created October 25, 2015 22:15
jQuery Date Range Slider Example with an Angular Web App Wrapper
<!DOCTYPE html>
<html ng-app="webApp">
<head>
<title>Title</title>
<meta charset="utf-8">
<script src="jquery-1.11.3.min.js"></script>
<script src="jquery-ui-1.11.4/jquery-ui.min.js"></script>
<!-- http://ghusse.github.io/jQRangeSlider/ -->
<script src="jQRangeSlider-5.7.1/jQDateRangeSlider-min.js"></script>
@mfyz
mfyz / Change Font.sketchplugin
Last active February 12, 2016 14:17 — forked from bomberstudios/Change Font.sketchplugin
Change font family for all text layers in Sketch
// Change font (ctrl a)
var doc = context.document,
selection = context.selection,
font_name = [doc askForUserInput:"Font name:" initialValue:"SF UI Display"];
function check_layer(layer){
log(layer)
var className = layer.className()
log("Checking layer " + layer + " of klass: " + className)
if (className == "MSTextLayer") {
// Select All Text Layers
var page = [doc currentPage],
layers = [page children]
[page deselectAllLayers]
var loop = [layers objectEnumerator]
while (layer = [loop nextObject]) {
if([layer className] == "MSTextLayer") {
@mfyz
mfyz / export_card_names.js
Last active March 25, 2017 05:04
Export trello card names in a list - userscript for Tampermonkey (or grease monkey browser extension)
// ==UserScript==
// @name Trello export card titles in a list
// @namespace http://www.mfyz.com/
// @version 1.0
// @description Export card names in a list
// @match https://trello.com/*
// @match https://*.trello.com/*
// @copyright 2017+, Mehmet Fatih Yildiz
// ==/UserScript==
@mfyz
mfyz / snippet.js
Created January 4, 2018 04:04
CodeMirror search programmatically
cmInstance.state.search = {
query: "search query",
lastQuery: null,
posFrom: null,
posTo: null,
overlay: null
};
cmInstance.execCommand('findNext');
@mfyz
mfyz / colors.php
Last active October 2, 2018 19:49
PHP Terminal Colors
<?php
/*
Taken from: https://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/
Short and simple form:
Before: \033[42m
After: \033[0m
@mfyz
mfyz / gl.html
Created January 10, 2019 18:23
simple webgl shader example (html)
<!-- Learn about this code on MDN: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Basic_2D_animation_example -->
<script id="vertex-shader" type="x-shader/x-vertex">
attribute vec2 aVertexPosition;
uniform vec2 uScalingFactor;
uniform vec2 uRotationVector;
void main() {
vec2 rotatedPosition = vec2(
@mfyz
mfyz / Gruntfile.js
Created April 29, 2019 02:47
Grunt Replace Example
module.exports = function (grunt) {
// measures the time each task takes
require('time-grunt')(grunt);
grunt.loadNpmTasks('grunt-replace');
grunt.initConfig({
// Store your Package file so you can reference its specific data whenever necessary
pkg: grunt.file.readJSON('package.json'),
@mfyz
mfyz / index.js
Created October 25, 2019 13:53
Single javascript file node/express/instagram authentication (oauth) and get user photos
const express = require('express')
const path = require('path')
const ig = require('instagram-node').instagram()
const cookieParser = require('cookie-parser')
// Set the config values below inline or from environment variables
const PORT = process.env.PORT || 8110
const IG_CLIENT_ID = process.env.IG_CLIENT_ID
const IG_CLIENT_SECRET = process.env.IG_CLIENT_SECRET
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const multer = require('multer');
const cloudinary = require('cloudinary');
const PORT = process.env.PORT || 4004;
const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, 'uploads/')