Skip to content

Instantly share code, notes, and snippets.

View cagcak's full-sized avatar
😱
ExpressionChangedAfterItHasBeenCheckedError

Çağrı cagcak

😱
ExpressionChangedAfterItHasBeenCheckedError
View GitHub Profile
@cagcak
cagcak / Welcome_.idea_.name
Created November 29, 2013 11:55
Welcome-to-IntelliJ
Wrlcome Project
@cagcak
cagcak / example.js
Last active August 26, 2019 18:12 — forked from millermedeiros/example.js
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
@cagcak
cagcak / A-json-formatter.js
Last active May 1, 2017 10:36
This script takes a deformed .json file as argument, then produces formed version.
var fs = require("fs");
var input = process.argv.slice(2).toString();
// USAGE:
// node 'script' 'target'
// (ex: node A-json-formatter.js a:\source\nodejs\formed.json)
fs.open(input, 'r', (err, fd) => {
if (err) {
if (err.code === 'ENOENT') {
@cagcak
cagcak / login.bash
Created June 27, 2017 21:12
Simple user-interaction based bash login script
#!/bin/bash
# Simple user-interaction based login script
username="root"
password="toor"
#set -x #tracing code line on
echo "You have 10 sec to type"
@cagcak
cagcak / _partials.js
Last active June 6, 2018 11:54
Calling with data- attribute partial html files
/* Author: cagcak
* Requirement: jQuery >= 1.x
* Usage : place html partial, call as partialBoneCaller(int level) in main html with
* data-include='./partials/nav.html'
*/
function partialBoneCaller (level) {
'use strict'
var includes = $('[data-include]')
var x = '../'
jQuery.each(includes, function () {
@cagcak
cagcak / _i18n_switch.html
Created May 27, 2018 16:25
Slider switch functionality for jquery-i18n localization in a html partial view
<script src="./node_modules/jquery/dist/jquery.min.js"></script>
<input id="i18n-switch" type="checkbox" data-toggle="toggle" data-on="EN" data-off="TR">
<script type="text/javascript">
const getRoot = function () {
return window.document.location.origin.toString()
}
const CONF = {
prefix: '?locale=',
lang: ['en', 'tr'],
@cagcak
cagcak / monster_slayer_game_vue.html
Created May 27, 2018 18:18
Simple game called Monster Slayer with Max on udemy
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="author" content="">
<meta name="description" content="">
<script src="https://npmcdn.com/vue/dist/vue.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.0.0/css/foundation.min.css" />
</head>
<body>
@cagcak
cagcak / i18n.php
Last active June 6, 2018 11:52
A simple routing function with i18n json data
<?php
define('i18n', dirname(__DIR__) . '/locales/');
function __($phrase) {
$locale = $GLOBALS['APPLANG'];
static $trans = NULL;
$ext = '.json';
if (is_null($trans)) {
$lang_file = i18n . $locale . $ext;
@cagcak
cagcak / postman_install.sh
Created July 26, 2018 06:20 — forked from posemon/postman_install.sh
Postman install Ubuntu 18.04
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
@cagcak
cagcak / drag-drop.html
Created September 1, 2018 09:27
Simple Drag and Drop application in Vanilla JS by TraversyMedia
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: darkgrey;