Skip to content

Instantly share code, notes, and snippets.

View h4ck4life's full-sized avatar

Alif h4ck4life

  • Dev.
  • Kuala Lumpur
View GitHub Profile
@h4ck4life
h4ck4life / media-query.css
Created September 10, 2019 16:15 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@h4ck4life
h4ck4life / .gitignore
Created July 23, 2019 15:25 — forked from mchelen/.gitignore
example: browserify + jquery + grunt
*~
bundle.js
bundle.min.js
node_modules
@h4ck4life
h4ck4life / dev-machine.sh
Created June 26, 2019 12:01
Install all the necessary tools for a developer machine on Ubuntu 14.04
#!/bin/bash
# All the configuration settings described below were found on the internet,
# and this script just automates it
# Generating locales
sudo locale-gen en_US en_US.UTF-8 pt_BR pt_BR.UTF-8 es_ES es_ES.UTF-8
# Installing base packages
sudo apt-get update

How To - Upload and add Images to markdown files in Gist

Markdown files allow embedding images in it. However it requires the image to be hosted at some location and we can add the url of the image to embed it.

Example: ![Alternate image text](https://someurl/imagelocation/image.png)

We can use services like imgur or other services to host the images and use the hosted URL.

@h4ck4life
h4ck4life / main.dart
Created December 10, 2018 14:15 — forked from StrykerKKD/main.dart
Web scraping with Dart 2
import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:html/parser.dart' as parser;
import 'package:html/dom.dart';
main() async {
http.Response response = await http.get('https://news.ycombinator.com/');
Document document = parser.parse(response.body);
@h4ck4life
h4ck4life / gist:aa27b0e897091f8aeec745661ac1753d
Created August 15, 2018 12:01 — forked from thomasgriffin/gist:4733283
Map subdomains to URLs in nginx with WordPress.
server {
listen 80;
listen 443 ssl;
server_name ~^(?<user>[a-zA-Z0-9-]+)\.example\.com$;
location / {
resolver 8.8.8.8;
rewrite ^([^.]*[^/])$ $1/ permanent;
proxy_pass_header Set-Cookie;
proxy_pass $scheme://example.com/user/$user$request_uri;
@h4ck4life
h4ck4life / settings.json
Created August 8, 2018 07:31 — forked from JohannesHoppe/settings.json
VSCode: proxy settings
// VSCode: Place your settings in this file to overwrite the default settings
{
"http.proxy": "http://user:pass@proxy.com:8080",
"https.proxy": "http://user:pass@proxy.com:8080",
"http.proxyStrictSSL": false
}

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@h4ck4life
h4ck4life / colab_download.py
Created June 28, 2018 04:27 — forked from korakot/colab_download.py
Google colab file upload/download
files.download('example.txt') # from colab to browser download
@h4ck4life
h4ck4life / build.gradle
Created June 20, 2018 07:29 — forked from gpeal/build.gradle
Airbnb Gradle Flavors
...
apply from: './flavors.gradle'
...
android {
buildTypes {
productFlavors {
project.flavors.each { flavor, config ->
"$flavor" {
dimension 'scope'
if (flavor != 'full') {