Skip to content

Instantly share code, notes, and snippets.

View brkphp's full-sized avatar
🏠
Working from home

Burak Akdeniz brkphp

🏠
Working from home
View GitHub Profile
// console.log('OKEY');
function getQR() {
var qr = document.getElementsByTagName("canvas")[0];
return {connection: document.getElementsByTagName("canvas")[0] == null, qr: qr ? qr.toDataURL() : ""};
}
/*
export async function loadAllEarlierMessages(id, done) {
const found = WAPI.getChat(id);
@brkphp
brkphp / test.php
Created June 1, 2020 10:41
WordCount Test
<?php
class WordCountTest extends PHPUnit_Framework_TestCase
{
public function testCountOneWord()
{
$this->assertEquals(['word' => 1], wordCount('word'));
}
public function testCountOneOfEachWord()
{
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Noter
X-WR-TIMEZONE:Europe/Istanbul
X-WR-CALDESC:noter app
BEGIN:VEVENT
DTSTART:20200325T120000Z
@brkphp
brkphp / Localizable.swift
Created April 11, 2019 11:57
swift easy localizable
//
// Localizable.swift
// AnimatedLivePaper
//
// Created by Burak on 4/11/19.
// Copyright © 2019
//
import Foundation
import UIKit
@brkphp
brkphp / gist:7973f0db72f9907e287ea93f68e8388d
Last active November 15, 2018 08:45
PasscodeRepository
import UIKit
import Foundation
import PasscodeLock
class PasscodeRepository: PasscodeRepositoryType {
private let passcodeKey = "passcode.lock.passcode"
var hasPasscode: Bool {
@brkphp
brkphp / iota rebroadcast
Last active January 26, 2018 12:53
iota rebroadcast
'use strict';
var IOTA;
const IOTA = require('iota.lib.js');
var tx = "yourtx"
const iota = new IOTA({
'host': 'http://iri4.iota.fm',
'port': 80
@brkphp
brkphp / l5simpleBreadcumbs
Last active June 9, 2021 15:57
Laravel 5 simple breadcumbs
@php
$link = url('/');
@endphp
@for($i = 1; $i <= count(\Illuminate\Support\Facades\Request::segments()); $i++)
<li class="breadcrumb-item">
@if($i < count(\Illuminate\Support\Facades\Request::segments()) & $i > 0) <?php $link .= "/" . \Illuminate\Support\Facades\Request::segment($i); ?>
<a href="<?= $link ?>">{{\Illuminate\Support\Facades\Request::segment($i)}}</a> {!!'<i class="fa fa-angle-right"></i>'!!} @else {{\Illuminate\Support\Facades\Request::segment($i)}} @endif
</li>
@endfor