Skip to content

Instantly share code, notes, and snippets.

View vogloblinsky's full-sized avatar

Vincent Ogloblinsky vogloblinsky

View GitHub Profile
@manekinekko
manekinekko / angular-1-typescript.md
Created January 25, 2017 14:57
Writing AngularJS (>=1.5) component using Angular (>=2) approach with TypeScript...

If you want to write an AngularJs (1.5) component using Angular (>=2) approach, you could use:

In app.module.ts

import { FooComponent } from './foo.component';

angular.module('app.module', [])
  .component('fooComponent', FooComponent);
@openfirmware
openfirmware / nginx-site.conf
Created May 2, 2016 18:08
nginx proxy to VLC HTTP stream to add CORS headers
server {
listen 8000;
server_tokens off;
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
@Restuta
Restuta / framework-sizes.md
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@sasxa
sasxa / emitter.service.ts
Created January 2, 2016 05:27
Angular2 Communicating between sibling components
import {Injectable, EventEmitter} from 'angular2/core';
@Injectable()
export class EmitterService {
private static _emitters: { [ID: string]: EventEmitter<any> } = {};
static get(ID: string): EventEmitter<any> {
if (!this._emitters[ID])
this._emitters[ID] = new EventEmitter();
return this._emitters[ID];
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@manekinekko
manekinekko / cordova-batch-install-plugins.sh
Created August 13, 2015 14:34
This script uses the `plugins/fetch.json` cordova file to batch install all the required plugins at once.
#!/usr/bin/env node
//this hook installs all your plugins
// add your plugins to this list--either
// the identifier, the filesystem location
// or the URL
var plugins = require('./plugins/fetch.json');
var pluginlist = [];
@anvaka
anvaka / modules.md
Last active January 16, 2019 14:45
npm modules with highest pagerank

This excercise computes PageRank of npm dependencies graph.

  1. Download all npm modules: wget https://skimdb.npmjs.com/registry/_design/scratch/_view/byField
  2. Convert them into ngraph.graph using convertToGraph.js script.
  3. Run rank.js (see below):

Number of nodes: 123,969; Number of edges: 281,471; PageRank computed in 1,187 ms;

  1. underscore - 0.0132458168541106
  2. lodash - 0.012808245947189859
@DavidFrahm
DavidFrahm / release-android.sh
Last active February 22, 2017 12:15
Ionic build Android app for release, with option to open (in app such as HockeyApp for deploying to team)
#!/bin/bash
FINAL_BINARY_FILEPATH="platforms/android/build/outputs/apk/wakatime-android-release-signed.apk"
echo "*** Build Ionic release for Android ***"
rm $FINAL_BINARY_FILEPATH
ionic build --release android
echo "Signing APK..."
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/Dropbox/WakaTime/Build/Android/wakatime.keystore -storepass $WAKATIME_STOREPASS platforms/android/build/outputs/apk/android-release-unsigned.apk android
echo "Optimizing APK (zipalign)..."
~/Library/Android/sdk/build-tools/23.0.3/zipalign -v -f 4 platforms/android/build/outputs/apk/android-release-unsigned.apk $FINAL_BINARY_FILEPATH
# echo "Opening APK..."
@nikcorg
nikcorg / berlin-jsconf-2014.md
Last active August 4, 2023 12:45
Slide decks of JSConf 2014
@panurge-ws
panurge-ws / gist:525caef640784a487aa2
Last active May 20, 2016 10:38
A Videgular plugin to emulate background-size CSS property for video (see comment below).
/*
* vg-bkg-size
* A Videogular plugin to emulate background-size CSS property for video: "cover" or "contain"
*
* Use:
* <videogular vg-bkg-size="cover" center="true"></videogular>
* vg-bkg-size => "cover" or "contain"
* center => true or false
*
* Copyright (c) 2014 Panurge Web Studio