Skip to content

Instantly share code, notes, and snippets.

View jrgcubano's full-sized avatar

Jorge Rodríguez Galán jrgcubano

View GitHub Profile
@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active July 7, 2024 19:31
Reading configuration files before application startup in Angular2 final release

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

@donmccurdy
donmccurdy / .block
Last active August 8, 2019 21:37
Google Maps + D3 Overlay
license: mit
@jrgcubano
jrgcubano / CheckColorExtensions.cs
Last active July 8, 2024 16:09
ExtendedDatePicker with Nullable values for Xamarin.Forms
using UIKit;
using Xamarin.Forms;
namespace Check.iOS.Extensions
{
/// <summary>
/// Color extensions
/// </summary>
public static class CheckColorExtensions
{
anonymous
anonymous / EscapeTheTrolls.java
Created August 2, 2016 20:47
import javax.swing.JFrame;
import asciiPanel.AsciiPanel;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.*;
import java.awt.Color;
public class EscapeTheTrolls extends JFrame implements KeyListener {
public static final int WIDTH = 39;
@JonCole
JonCole / Redis-BestPractices-General.md
Last active March 13, 2025 14:30
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@cladera
cladera / karma-conf.js
Last active April 30, 2020 00:59
AngularJs: Testing directive with templateUrl
// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2015-06-05 using
// generator-karma 0.9.0
module.exports = function(config) {
'use strict';
config.set({
// enable / disable watching file and executing tests whenever any file changes
@btroncone
btroncone / ngrxintro.md
Last active March 5, 2025 20:40
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@Maverik
Maverik / CSRGenerator.cs
Last active August 4, 2020 10:56
CSR Generator Snippet for Linqpad (C#)
// this snippet can be easily used in any normal c# project as well by simply removing the .Dump() methods
// and saving the output into a variable / file of your choice.
// you'll need to add BouncyCastle.Crypto nuget to use this.
// tested on 1.8.1
// OUTPUTS: CSR, Private Key, Public Key, Self-signed Certificate
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.Cms;
using Org.BouncyCastle.Asn1.Pkcs;
using Org.BouncyCastle.Asn1.X509;
@robdmoore
robdmoore / _readme.md
Last active April 12, 2018 08:57
NodeJS Script to automate deployment of Cordova/PhoneGap application using PhoneGapBuild

pgb-wrapper.js is a generic wrapper module around the phonegap-build-api NodeJS package to add promise support and some helpful functions to make it easier to create a build script.

pgb.example.js is one example of such a build script, but you might decide to do it differently.

You can execute pgb.example.js by:

node pgb.example.js --appId {PGB_APP_ID} --apiKey {PGB_API_KEY} --zipFile {path/to/deployment_file.zip} --iosOverTheAirKey {NAME_OF_IOS_OVER_THE_AIR_KEY_IN_PGB} --iosOverTheAirKeyPassword {PASSWORD_OF_IOS_OVER_THE_AIR_KEY_IN_PGB} --iosKey {NAME_OF_IOS_PRODUCTION_KEY_IN_PGB} --iosKeyPassword {PASSWORD_OF_IOS_PRODUCTION_KEY_IN_PGB} --androidKey {NAME_OF_ANDROID_PRODUCTION_KEY_IN_PGB} --androidKeyPassword {PASSWORD_OF_ANDROID_PRODUCTION_KEY_IN_PGB}

The following node packages need to be installed for it all to work:

  • phonegap-build-api