Skip to content

Instantly share code, notes, and snippets.

View cristianofromagio's full-sized avatar
👨‍💻
Quit the talking

Cristiano Fromagio cristianofromagio

👨‍💻
Quit the talking
  • Brazil
View GitHub Profile
@nucklehead
nucklehead / cleanIcon.js
Last active May 16, 2024 22:46
Script to clean unused icons in ionic
#!/bin/env node
let path = require('path'), fs=require('fs');
function fromDir(startPath, filter, callback){
if (!fs.existsSync(startPath)){
console.log("no dir ",startPath);
return;
}
@hkan
hkan / whatsapp-web-emoji-keywords.txt
Created April 30, 2018 16:25
Emoji shortcut keywords for Whatsapp Web
0⃣ 0, keycap, zero
1⃣ 1, number, one
🕜 1, 30, clock, time, one, thirty, 1:30, one-thirty
🕐 1, clock, time, one, 00, o’clock, 1:00, one o’clock
2⃣ 2, number, two
🕝 2, 30, clock, time, two, thirty, 2:30, two-thirty
🕑 2, clock, time, two, 00, o’clock, 2:00, two o’clock
3⃣ 3, keycap, three
🕞 3, 30, three, clock, time, thirty, 3:30, three-thirty
🕒 3, three, clock, time, 00, o’clock, 3:00, three o’clock
@davidfurlong
davidfurlong / JSON.stringify-replacer-sort-keys.js
Last active May 5, 2024 06:00
JSON.stringify replacer function for having object keys sorted in output (supports deeply nested objects)
// Spec http://www.ecma-international.org/ecma-262/6.0/#sec-json.stringify
const replacer = (key, value) =>
value instanceof Object && !(value instanceof Array) ?
Object.keys(value)
.sort()
.reduce((sorted, key) => {
sorted[key] = value[key];
return sorted
}, {}) :
value;
@rafael-neri
rafael-neri / validar_cpf.php
Last active April 27, 2024 21:49
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
@julianpoemp
julianpoemp / .angular-htaccess.md
Last active April 14, 2024 21:40
Optimal .htaccess configuration for Angular 15, Angular 14, Angular 13, Angular 12, Angular 11, Angular 10, Angular 9, Angular 8, Angular 7, Angular 6, Angular 5 (and older) app in production incl. fix for the angular browser caching issue.

New generator

I created a new htaccess generator for angular apps that makes it easier for you to create the optimal htaccess file: https://julianpoemp.github.io/ngx-htaccess-generator/

The goal of this generator is to create the optimal .htaccess file for Angular apps easily. By default the generator creates an .htaccess file that solves the route redirection issue. To make it easier for you I created a kind of interview mode with some questions. As an additional feature the generator supports adding exclusions for example if you have installed a blog in a subdirectory of your web application and more!

The generator 😁: https://julianpoemp.github.io/ngx-htaccess-generator/

The project: https://github.com/julianpoemp/ngx-htaccess-generator

@taterbase
taterbase / system-beep.js
Created July 21, 2012 05:01
System Beep in Node.js
function alertTerminal(){
console.log("\007");
}
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@sagrawal31
sagrawal31 / events.ts
Last active January 26, 2024 13:22
Alternative to Events which got removed in Ionic 5
import {Injectable} from '@angular/core';
import {Subject, Subscription} from 'rxjs';
/**
* A custom Events service just like Ionic 3 Events https://ionicframework.com/docs/v3/api/util/Events/ which got removed in Ionic 5.
*
* @author Shashank Agrawal
*/
@Injectable({
providedIn: 'root'
@Oldenborg
Oldenborg / AssertJson.php
Last active October 2, 2023 22:50
Laravel test trait: assert JSON exact
<?php
namespace Tests\Traits;
use Illuminate\Testing\TestResponse;
use Illuminate\Support\Arr;
use PHPUnit\Framework\Assert as PHPUnit;
trait AssertJson
{
@7kfpun
7kfpun / gist:41d4fda1f9486cb79e9ca5f72ce05a5b
Created June 12, 2016 14:50
Round corners of an image with ImageMagick
convert -size 512x512 xc:none -draw "roundrectangle 0,0,512,512,40,40" png:- | convert src.png -matte - -compose DstIn -composite dst.png