Skip to content

Instantly share code, notes, and snippets.

View alifhaikal88's full-sized avatar
💭
I may be slow to respond.

Alif Haikal Razak alifhaikal88

💭
I may be slow to respond.
  • Squickydoodle
  • Germany
View GitHub Profile
@btroncone
btroncone / ngrxintro.md
Last active July 5, 2025 14:15
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

@sasxa
sasxa / BaseRoute.ts
Last active July 25, 2018 17:23
Angular2 Redirection using @ngrx/store
export class _BaseRoute {
public store: Store<any> = getSingleton(Store);
public title: string;
constructor() { }
routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) {
this.store.dispatch({ type: "UPDATE_ROUTE", payload: { next, prev } });
this.store.dispatch({ type: "UPDATE_UI", payload: { title: this.title } });
}
@cypar
cypar / zip-excluding-specific-directories-and-files.md
Created February 17, 2016 03:13
Zip excluding specific directories and files

Zip excluding specific directories

Exclude .git file and node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/\*

Exclude .git file and files in node_modules directory, but keep node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/**\*
@branflake2267
branflake2267 / HangingGrid.java
Created February 12, 2016 20:46
Workaround for Chrome 48 and GXT 2 issue
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoader;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
@branflake2267
branflake2267 / error.txt
Created February 8, 2016 16:40
chrome 48 gxt 2.3.1a exception
SEVERE: (TypeError) : Cannot read property 'style' of null
com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'style' of null
at Unknown.FAg(Exceptions.java:36)
at Unknown.B_e(ColumnHeader.java:1001)
at Unknown.C_e(ColumnHeader.java:1043)
at Unknown.Y_e(ColumnHeader.java:958)
at Unknown.jcc(GridView.java:1980)
at Unknown.Occ(GridView.java:1975)
at Unknown.kbc(GridView.java:1057)
at Unknown.Cbc(GridView.java:1420)
@parthpower
parthpower / !WhatsApp On Web Monitor.md
Last active August 10, 2024 13:42
Simple JS to monitor offline and online time of a contact.

WhatsApp On Web Monitor

What It does

It gives notifications when someone goes online or offline or typing. Open chat of the contact you want to monitor and start script.

Simple Way

@endel
endel / number-pad-zero.js
Last active August 1, 2023 11:54
Simplest way for leading zero padding in JavaScript
Number.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = "0" + s;}
return s;
}
(1).pad(3) // => "001"
(10).pad(3) // => "010"
(100).pad(3) // => "100"
@PickledDragon
PickledDragon / list-constraints.sql
Created October 25, 2015 11:30
Postgres list all constraints
SELECT
tc.constraint_name, tc.table_name, kcu.column_name,
ccu.table_name AS foreign_table_name,
ccu.column_name AS foreign_column_name
FROM
information_schema.table_constraints AS tc
JOIN information_schema.key_column_usage AS kcu
ON tc.constraint_name = kcu.constraint_name
JOIN information_schema.constraint_column_usage AS ccu
ON ccu.constraint_name = tc.constraint_name
@apolloclark
apolloclark / postgres cheatsheet.md
Last active June 28, 2025 15:55
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@Yimiprod
Yimiprod / difference.js
Last active July 15, 2025 07:48
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {