Skip to content

Instantly share code, notes, and snippets.

View muratcorlu's full-sized avatar

Murat Çorlu muratcorlu

View GitHub Profile
anonymous
anonymous / Bahceli.php
Created October 19, 2015 16:41
<?php
class Bahceli {
function __call($name, $args) {
if (preg_match('/yak|dov/i', $name)) {
return true;
} else {
return false;
}
}
@ckimrie
ckimrie / example.component.ts
Last active December 12, 2023 20:53
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
@Component({
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class ExampleComponent implements OnInit, OnDestroy {
@FinlayDaG33k
FinlayDaG33k / USAGE.md
Created February 6, 2021 08:57
Matrix Synapse stack with Docker stack compose and Docker Swarm
  1. Change docker-stack-compose.yml line 37 to have a secure password.
  2. Change matrix-202004202244.yml line 621 to the password set in step 1
  3. Change matrix-202004202244.yml line 1024 to have a secure secret (or leave empty).
  4. Generate a signing key and add it in a config/secret (see docker-stack-compose.yml line 62), I forgot how to do this
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {