Skip to content

Instantly share code, notes, and snippets.

View nombrekeff's full-sized avatar
🤘
Working on Cardboard

Manolo Edge nombrekeff

🤘
Working on Cardboard
View GitHub Profile
@nombrekeff
nombrekeff / FlutterLocalization.dart
Created March 27, 2020 12:24
A couple of classes for managing Translations in flutter, from json, with interpolation.
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
class AppLocalizations {
final Locale locale;
AppLocalizations(this.locale);
// Helper method to keep the code in the widgets concise
@nombrekeff
nombrekeff / advanced-ts-2.md
Last active February 11, 2020 11:29
Gist for "Advanced TypeScript Exercises - Question 2"

PD: I don't know if it's the correct answer, but it's what I would of done :)

I think it fails because we always expect the output type to be equal to the generic type, although we always return a User.

Typescript tells us that if we pass in a generic type, for example:

createCustomer<{  id: number, kind: string, other: number }>({ 
  id: 1, 
  kind: 'customer' 
});
@nombrekeff
nombrekeff / shebang, linux, bash,
Created February 10, 2020 14:49
[bash sebang] #!/bin/bash
#!/bin/bash
@nombrekeff
nombrekeff / ghowda.meta
Last active February 8, 2020 22:14
This is a test ghowda blog (javascript, demo)
{
"labels": ["test", "javascript"],
"title": "Blog 1"
}
@nombrekeff
nombrekeff / docker-stopall.sh
Last active February 11, 2020 09:28
[docker stop all] stop or kill all containers #docker
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@nombrekeff
nombrekeff / git-reverse-commit.sh
Created January 23, 2020 09:47
[Git reverse last commit]
git checkout Branch1
git reset --hard HEAD~1
@nombrekeff
nombrekeff / ng-for-template.ts
Created January 22, 2020 10:46
[Ng Template ngFor] Angular ng-template with ngFor #angular
<ng-template ngFor let-act [ngForOf]="account.activities">
</ng-template>

Undo commit:

git reset --soft HEAD~1
{
"data": {
"finishedAt": "2019-06-04T13:27:35.747Z",
"hasFailed": false,
"hasFinished": false,
"retries": 0,
"_id": "5cf67170a8facf0036e3e614",
"id": "1bcd328f-8271-4048-a11f-584197e2b454",
"status": "1006",
"msg": {
@nombrekeff
nombrekeff / test-data-output.json
Last active May 10, 2019 09:27
Little example of data output from `/in/santoslluis`
{
"education": [
{
"name": "Universitat Jaume I",
"degree": "Degree Name\nComputer Engineering",
"dateRange": {
"start": 2007,
"end": 2011
},
"link": "https://www.linkedin.com/school/12259/?legacySchoolId=12259",