Skip to content

Instantly share code, notes, and snippets.

View zaferayan's full-sized avatar
⚛️
Overreacting

Zafer AYAN zaferayan

⚛️
Overreacting
View GitHub Profile
@zaferayan
zaferayan / env.json
Created May 16, 2021 12:15
Heroku environment variables
{
"npm_config_cache_lock_stale": "60000",
"npm_config_ham_it_up": "",
"npm_config_legacy_bundling": "",
"npm_config_sign_git_tag": "",
"DATABASE_URL": "postgres://lkiqysqmjmgpjt:[email protected]:5432/df212u6qn2l0a6",
"npm_package_devDependencies_jest": "^26.6.3",
"npm_config_user_agent": "npm/6.14.13 node/v14.17.0 linux x64",
"npm_config_always_auth": "",
"npm_package_jest_testEnvironment": "node",
@zaferayan
zaferayan / index.js
Created March 11, 2021 22:56
Tails a file that served on specified URL.
var http = require('http');
var fs = require('fs');
var path = require('path');
const URL = "http://blabla/server.log";
const FILE = "server.log";
var download = function(url, dest, cb) {
var file = fs.createWriteStream(path.join(__dirname, dest));
http.get(url, function(response) {
@zaferayan
zaferayan / anket.json
Created January 16, 2021 12:16
Frontend Developer Maaş Anketi JSON içeriği https://twitter.com/feistanbul/status/1350388076900720642
[
{
"timestamp": "2020-12-08T10:49:00.591Z",
"title": "Mid-Level Frontend Developer",
"experience": "2-4 Yıl",
"organizationtype": "Kurumsal",
"employeecount": "25 - 50 Kişi",
"benefits": "Yemek Kartı, Özel Sağlık Sigortası, Ulaşım Ücreti/Servis, Eğitim Bütçesi",
"covidsupport": "Hayır",
"remotework": "Evet, haftanın belli günleri evden çalışıyorum.",
@zaferayan
zaferayan / RemoveUnusedArchitectures.sh
Last active January 5, 2021 14:32
This script fix this issue on iOS: "Unsupported Architecture. Your executable contains unsupported architecture '[x86_64, i386]"
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
@zaferayan
zaferayan / NotHesaplamaArray.js
Created January 3, 2021 12:31
Not hesaplama
const MSG_FF = "Dersi geçemediniz.";
const MSG_FD = "Dersi geçemediniz";
const MSG_DD = "Dersi DD ile geçtiniz.";
const MSG_DC = "Dersi DC ile geçtiniz.";
const MSG_CC = "Dersi CC ile geçtiniz.";
const MSG_CB = "Dersi CB ile geçtiniz.";
const MSG_BB = "Dersi BB ile geçtiniz.";
const MSG_BA = "Dersi BA ile geçtiniz.";
const MSG_AA = "Dersi AA ile geçtiniz.";
@zaferayan
zaferayan / WithoutIf.js
Created January 3, 2021 11:56
Not hesaplama
const vize = 50, final = 50;
var not = (vize * 0.4) + (final * 0.6);
console.log("Yıl sonu notunuz = " + not);
if (not > 90) {
console.log("AA ile dersi geçtiniz.");
}
else if (not > 85) {
console.log("BA ile dersi geçtiniz.");
@zaferayan
zaferayan / style.css
Created November 14, 2020 11:20
Media queries for laptop tablet and mobile
@media screen and (max-width: 1024px) {
/* Laptop (1024px) */
}
@media screen and (max-width: 768px) {
/* Tablet (768px) */
}
@media screen and (max-width: 320px) {
/* Phone (Small) */
@zaferayan
zaferayan / README.md
Last active August 12, 2020 12:33
How to bulk shorten a list of URLs with bash commands via bit.ly API
@zaferayan
zaferayan / HideTweetMediaWithoutAltTag.js
Created July 23, 2020 21:09
Hides image and video elements that have no proper alt tag
(function() {
let style =
`<style>
[data-testid="tweetPhoto"][aria-label="Resim"],
[aria-label="Yerleştirilmiş video"]{
display:none;
}
</style>`;
document.head.insertAdjacentHTML("beforeend", style);
})();
@zaferayan
zaferayan / index.html
Created May 23, 2020 14:56
Reactive input element in AlpineJS
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js"></script>
<div x-data="{msg:''}">
<input x-model="msg" />
<span x-text="msg"></span>
</div>