Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View IAmJulianAcosta's full-sized avatar
🐶
Home is where the dog is

Julian Acosta IAmJulianAcosta

🐶
Home is where the dog is
View GitHub Profile
/*
* © 2016 - Julián Acosta
* License: CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0/)
*
* Print your own logo in developer tools!
*
* Step 1: Convert your logo to ASCII text here: http://picascii.com (I used color output)
* Note: Is possible that you'll have to resize your photo in order to retain aspect ratio
* Step 2: Remove the <pre></pre> tag that is surrounding the generated code, replace with "[" and "]"
* Step 3: Run the following regexes (*DON'T ALTER THE ORDER*) in order to convert to JSON (Works in PHPStorm and Sublime Text 2):
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
findRecord() {
return {
data: {
id: '1',
type: 'books',
attributes: {
config: {}
import Ember from 'ember';
import { A } from '@ember/array';
import ArrayProxy from '@ember/array/proxy';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init(...args) {
this._super(...args);
let a = ArrayProxy.create({
content: A(["hello", "world"])
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'get lucky'
});
@IAmJulianAcosta
IAmJulianAcosta / VmConfig.sh
Created April 21, 2017 01:24
Configure Ubuntu VM to compile Ember.js
#In some steps you should open a new tab and continue there
# Ubuntu packages
sudo apt-get update
sudo apt-get install -y autoconf automake python-dev make git curl samba-libs
# Node and npm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
nvm install 6.10.2
nvm use 6.10.2
@IAmJulianAcosta
IAmJulianAcosta / ember-object-name.js
Last active May 5, 2016 03:22
Get Ember object simple name from complex name
//Returns a string with full name of component, like: <ProjectName@component:path/to/component-name::ember793>
let componentName = this.toString ();
//This regex will match the component and capture the latest part of component path.
let regex = componentName.match (/<[a-zA-Z]+@[a-zA-Z]+:(?:[a-z]+[\/])*([-a-z]+)::[a-zA-Z]+[0-9]+>/);
//The latest element of array is the component name.
console.log (regex[regex.length-1]); //component-name
//See: https://regex101.com/r/rX9bQ7/3 for explanation
@IAmJulianAcosta
IAmJulianAcosta / charset_change.sql
Created October 24, 2015 17:31
Changing charset of all database tables
SELECT CONCAT( "ALTER TABLE `", TABLE_NAME, "` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" ) AS ExecuteTheString
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = "name_of_table"
AND TABLE_TYPE = "BASE TABLE"
LIMIT 0 , 30