Skip to content

Instantly share code, notes, and snippets.

View jsanta's full-sized avatar

Jose Ignacio Santa Cruz G. jsanta

View GitHub Profile
@davidmaogomezz
davidmaogomezz / Ionic Accordion List with Static Elements.markdown
Created September 16, 2015 18:11
Ionic Accordion List with Static Elements

Ionic Accordion List with Static Elements

An Ionic list directive, but instead of using a "FOR" statement it uses static elements.

A Pen by Daniel R. on CodePen.

License.

@jcubic
jcubic / ReflectService.java
Last active August 9, 2017 20:55
ReflectService plugin
package com.example.package;
import android.content.Context;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.io.PrintWriter;
@fennb
fennb / gist:1283573
Created October 13, 2011 06:35
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
@regilero
regilero / nginx.conf
Last active February 26, 2021 12:22 — forked from thoop/nginx.conf
Altered prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
# Generate $prerender_ua bool value based on user agent
# indexation bots will get this as 1,
# prerender user agent will always get 0 (avoid loops)
map $http_user_agent $prerender_ua {
default 0;
@sangress
sangress / replace.pipe.ts
Created December 27, 2016 16:22
Angular2 replace pipe
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'replace'
})
export class ReplacePipe implements PipeTransform {
transform(value: string, expr: any, arg2: string): any {
if (!value)
return value;
@gianpaj
gianpaj / extractCSS.js
Created March 25, 2019 09:52
Extract used CSS from a page
# Extract used CSS from a page
# https://stackoverflow.com/a/55334749/728287
#
# $ node extractCSS.js ~/Desktop/Coverage-20190325T110812.json
const fs = require('fs');
let final_css_bytes = '';
let total_bytes = 0;
let used_bytes = 0;
@Stanback
Stanback / nginx.conf
Last active February 4, 2022 18:05
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.
# 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;
@bobvanderlinden
bobvanderlinden / example.html
Last active October 28, 2022 20:41
Simple QR-Code scanner based on jsqrcode
<html>
<head>
<script src="https://webqr.com/llqrcode.js"></script>
<script src="jsqrcode-camera.js"></script>
</head>
<body>
<div id="qrcodescanner"></div>
<div id="message"></div>
</body>
<script>
@rami-alloush
rami-alloush / mask.directive.ts.md
Last active December 24, 2022 08:12 — forked from gund/mask.md
Simple Angular mask directive

Simple Angular mask directive

This directive does not create it's own value accessor - it simply reuses whatever element is using already and just hooks in.

Also it is fully abstracted off of the HTML implementation and so can be safely used in WebWorker and server side environment.

Usage