Skip to content

Instantly share code, notes, and snippets.

View mike1e's full-sized avatar

Michael Le mike1e

View GitHub Profile
@denzildoyle
denzildoyle / Ionic Notes.md
Last active September 19, 2017 13:37
Ionic notes: How to get started with Ionic mobile application development framework.

##Getting Started with Ionic Framework

Ionic is a powerful, beautiful and easy to use open source front-end framework built on top of AngularJs (a client-side javascript framework), Sass Syntactically Awesome Style Sheets Apache Cordova for and developing hybrid (cross platform) mobile apps.

Ionic's ultimate goal is to make it easier to develop native mobile apps with HTML5, also known as Hybrid apps.

Install nodejs: http://nodejs.org/

    npm install -g cordova ionic
@clowestab
clowestab / Instagram-ghost.js
Created November 10, 2018 16:50
A script for synchronising your Instagram posts with your Ghost blog as discussed on my blog (https://thomasclowes.com)
const Parser = require('rss-parser');
const request = require('request');
const fs = require('fs');
const mime = require('mime-types');
const slugify = require('slugify');
//Enter your ghost credentials here
const clientId = "ghost-frontend";
const clientSecret = "enter-your-secret";
const username = "enter-your-email";
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@indexzero
indexzero / base64.js
Created November 27, 2010 23:38
An extremely simple implementation of base64 encoding / decoding using node.js Buffers
//
// Super simple base64 encoding / decoding with node.js
//
var base64 = exports = {
encode: function (unencoded) {
return new Buffer(unencoded).toString('base64');
},
decode: function (encoded) {
return new Buffer(encoded, 'base64').toString('utf8');
<template>
<div id="app">
<p>
Pending: {{ $store.state.getInfoPending }}
</p>
<p>
{{ $store.state.getInfoData }}
</p>
</div>
</template>

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

@temoto
temoto / helpers_data.py
Last active March 22, 2022 05:19
Part of py-helpers. Gzip compression shortcuts. Encoding. Database helpers. Retry decorator.
def namedlist(typename, field_names):
"""Returns a new subclass of list with named fields.
>>> Point = namedlist('Point', ('x', 'y'))
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain list
33
>>> x, y = p # unpack like a regular list
@rhythnic
rhythnic / vuex-reusable-functions.js
Last active October 21, 2022 07:41
Reusable Vuex Functions
// *******************************************************************
// ATTENTION
// This gist is now an npm module
// The API of some functions is altered slightly.
// All future work will happen in the repo.
//
// https://gitlab.com/rhythnic/vuex-intern
// *******************************************************************
// *******************************************************************
@MrDys
MrDys / gist:3512455
Created August 29, 2012 13:26
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id:
<div class="modal" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@anantn
anantn / firebase_create.js
Last active November 20, 2023 23:17
Firebase: Creating data if it doesn't exist. This snippet creates a user only if it doesn't already exist.
function go() {
var userId = prompt('Username?', 'Guest');
var userData = { name: userId };
tryCreateUser(userId, userData);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userCreated(userId, success) {
if (!success) {