Skip to content

Instantly share code, notes, and snippets.

Murat Çorlu muratcorlu

Block or report user

Report or block muratcorlu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ckimrie
ckimrie / example.component.ts
Last active Oct 30, 2019
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
View example.component.ts
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 {
View Bahceli.php
<?php
class Bahceli {
function __call($name, $args) {
if (preg_match('/yak|dov/i', $name)) {
return true;
} else {
return false;
}
}
@Vijar
Vijar / nginx_try_s3_fallback_ec2.conf
Created Jul 6, 2015
Try S3 for static content, then fallback to EC2 using Nginx as reverse proxy
View nginx_try_s3_fallback_ec2.conf
location ~* ^/static/(.*) {
set $s3_bucket 'your_bucket.s3.amazonaws.com';
set $url_full '$1';
# Not sure if I need the following options or not, need to look into it.
proxy_http_version 1.1;
proxy_set_header Host $s3_bucket;
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
@burkeholland
burkeholland / gist:7475bb40a305d9f35494
Created Apr 1, 2015
Customizing The Navigation Bar / Status Bar
View gist:7475bb40a305d9f35494

As I've been learning more and more about NativeScript, one of the first tasks I really dove into was learning how to customize the Navigation Bar for an iOS app. NativeScript has a Navbar component on the roadmap, but for now, it requires some knowledge about the underlying iOS implementation of UINavigationControllers, UIViewControllers and the like.  But fear not!  I have braved the treacherous waters of StackOverflow and the Objective-C docs and emerged, victorious and unscathed.

1

In this article, I’ll go over a few of the more common tweaks that you might be needing to make to the Navigation Bar or Status Bar. While NativeScript is a cross-platform framework, these tweaks apply specifically to iOS. However, most of the items that I will

@addyosmani
addyosmani / LICENSE.txt
Last active Aug 23, 2018 — forked from 140bytes/LICENSE.txt
Offline Text Editor in < 140 bytes (115 bytes). Powered by localStorage & contentEditable
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@thoop
thoop / nginx.conf
Last active Nov 11, 2019
Official prerender.io nginx.conf for nginx
View nginx.conf
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@Stanback
Stanback / nginx.conf
Last active Nov 4, 2019
Example Nginx configuration for serving pre-rendered HTML from Javascript pages/apps using the Prerender Service (https://github.com/collectiveip/prerender).Instead of using try_files (which can cause unnecessary overhead on busy servers), you could check $uri for specific file extensions and set $prerender appropriately.
View nginx.conf
# Note (November 2016):
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
@fatiherikli
fatiherikli / tabularize.py
Last active Dec 11, 2015
Loading tabular data in Python
View tabularize.py
def normalize_line(line):
return [piece.strip() for piece in line.split("|")[1:-1]]
def is_valid_line(line):
return "|" in line
def load(text):
lines = map(normalize_line,
filter(is_valid_line,
text.strip().splitlines()))
View gist:4145994
DELETE = "delete"
UPDATE = "update"
SELECT = "select"
INSERT = "insert"
QUOTE = "'"
def format_parameter(parameter, value):
return "%s = %s" % (parameter, determine_quote(value))
You can’t perform that action at this time.