Skip to content

Instantly share code, notes, and snippets.

View mrhieu's full-sized avatar

Hieu Pham mrhieu

View GitHub Profile
@nicobytes
nicobytes / deploy-gh.sh
Last active August 3, 2020 20:14
Deploy gh-pages ionic pwa
#!/bin/bash
git branch -D gh-pages
git push origin --delete gh-pages
git checkout -b gh-pages
ionic build --prod
find . -type d ! -path './www*' ! -path './.git*' ! -path '.' | xargs rm -rf
rm -r *.*
mv www/* .
rm -rf www
git add .
@Manduro
Manduro / keyboard-attach.directive.ts
Last active August 24, 2020 06:50
Ionic Keyboard Attach Directive
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { Keyboard } from '@ionic-native/keyboard';
import { Content, Platform } from 'ionic-angular';
import { Subscription } from 'rxjs/Subscription';
/**
* @name KeyboardAttachDirective
* @source https://gist.github.com/Manduro/bc121fd39f21558df2a952b39e907754
* @description
@famanson
famanson / ember-stuff.md
Last active August 29, 2015 14:25
EmberJS resources (Hanoi Javascript meetup)

EmberJS resources:

  • Main EmberJS website
  • ember-cli - command-line tools for project setup and deployment
  • ember-cli-deploy - lightning-fast deployment of Ember to redis/S3 included in eember-cli. You can find an example of a Redis-backed Flask-based Ember frontend endpoint I wrote here. An example deploy.js file that Esplorio uses can be found here
  • For those interested in Google Map integration, you can check this out (only compatible with Ember 1.13 for now - we skipped the latest version since 2.0 is coming up real soon)
  • For those interested in Ember server-side rendering, you can check out fastboot
  • A list of websites built with Ember can be found here
  • Esplorio
@bobbygrace
bobbygrace / trello-css-guide.md
Last active May 15, 2024 16:01
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@deshack
deshack / roboto-condensed.css
Last active September 9, 2023 08:24
Add Roboto Condensed to your project with @font-face CSS rule. See http://deshack.net/use-roboto-condensed-font-face-css-rule/ for a complete and detailed tutorial.
/**
* Include Roboto Condensed font in your project
*
* Download Roboto Condensed ttf files from Google Fonts and place it in the same directory of this CSS file
* You can then use this font in your project by setting
* font-face: "Roboto Condensed", Helvetica, Arial, sans-serif;
*
* @author Mattia Migliorini (deshack)
* @license MIT
*/
@CatTail
CatTail / htmlentity.js
Created November 30, 2012 08:27
Javascript: encode(decode) html text into html entity
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {