Skip to content

Instantly share code, notes, and snippets.

@gmocamilotd
gmocamilotd / 0_reuse_code.js
Last active Apr 26, 2018
markdown tips usar markdown Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gmocamilotd
gmocamilotd / sss
Last active Aug 2, 2018
(errorfix) syscall
View sss
# los errores de:
* dirscan
* noauthorize
*
en windows 10, se arrgelan asegurnadose de usar npm 5.3.0
otro manera es dando acceso comple to(full) a todas las cuentas que tenga el sistema
respecto de la carpeta en cuestion
@gmocamilotd
gmocamilotd / tt
Last active Sep 28, 2017
angular, errorfix
View tt
## Can't bind to 'ngModel' since it isn't a known property of 'input'
### resuelve
Yes that's it, in the app.module.ts, I just added :
```
import { FormsModule } from '@angular/forms';
[...]
@NgModule({
@gmocamilotd
gmocamilotd / jj
Last active Sep 20, 2017
(angular)
View jj
If you need access to a function from several places, consider putting it in a service as mentioned before
el ejemplo completo:
View md1
1. take a look at [Chrome Devtools](https://developer.chrome.com/devtools) (given you use Chrome which has very neat devtools build-in).
2. I also often suggest people to do the [free Code School course](http://discover-devtools.codeschool.com/) on Discover Devtools which is nice as well.
3. Open web developer console, go to "Sources" section. Press "CTRL+P". A search box will open where type ".ts" and find your file or directly search your file like "myfile.ts". Open it and you can put breakpoints directly in the code, the same way we put breakpoints in a js file and Voila, you can debug Typescript.
4. In the case of TypeScript, also make sure that you enable sourcemaps. As you probably know TypeScript isn't directly executed by the browser, but rather it is being "compiled" (or as it's called "transpiled") into JavaScript. That said, you probably don't wanna debug the transpiled JS but rather the TypeScript code you wrote. To enable sourcemaps, set the proper flag in your __tsconfig.json__:
```
{
View as
# http://fontawesome.io/get-started/
Font Awesome CDN is the easiest way to get Font Awesome on your website or app,
all with just a single line of code. No downloading or installing!
## Download & Customize
Want to manage and host Font Awesome assets yourself? You can download, customize,
and use the icons and default styling manually.
Both CSS and CSS Preprocessor (Sass and Less) formats are included.
@gmocamilotd
gmocamilotd / in data base
Last active Dec 4, 2017
Ideally there would be a way for Postgres to handle both of these concerns: generate the string ensure its uniqueness source: https://stackoverflow.com/questions/19530736/how-can-i-generate-a-unique-string-per-record-in-a-table-in-postgres
View in data base
CREATE FUNCTION make_uid() RETURNS text AS $$
DECLARE
new_uid text;
done bool;
BEGIN
done := false;
WHILE NOT done LOOP
new_uid := md5(''||now()::text||random()::text);
done := NOT exists(SELECT 1 FROM my_table WHERE uid=new_uid);
END LOOP;
View noname
### [Returning Command](https://www.postgresql.org/docs/9.5/static/dml-returning.html)
### [How to return result of a SELECT inside a function in PostgreSQL?](https://stackoverflow.com/questions/7945932/how-to-return-result-of-a-select-inside-a-function-in-postgresql)
### [varibles del entorno](https://www.postgresql.org/docs/8.3/static/plpgsql-statements.html)
### [PostgreSQL SQL Tricks](https://postgres.cz/wiki/PostgreSQL_SQL_Tricks)
### [System Information Functions](https://www.postgresql.org/docs/8.1/static/functions-info.html)
@gmocamilotd
gmocamilotd / css
Last active Dec 7, 2017
#css asume claro que tiene un elemento cuyo ID es 'footer'
View css
#footer {
position: fixed;
bottom: 0;
width: 100%;
}
View elcss
.left, .right {
float: none;
padding: 20px;
width: 50%;
vertical-align: top;
}
.container {
display: table;
width: 100%;