Skip to content

Instantly share code, notes, and snippets.

💭
Everything not saved will be lost

Alif h4ck4life

💭
Everything not saved will be lost
Block or report user

Report or block h4ck4life

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@h4ck4life
h4ck4life / dev-machine.sh
Created Jun 26, 2019 — forked from ramirovjr/dev-machine.sh
Install all the necessary tools for a developer machine on Ubuntu 14.04
View dev-machine.sh
#!/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
View Adding Images to markdown files in Gist.markdown

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 Dec 10, 2018 — forked from StrykerKKD/main.dart
Web scraping with Dart 2
View main.dart
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 Aug 15, 2018 — forked from thomasgriffin/gist:4733283
Map subdomains to URLs in nginx with WordPress.
View gist:aa27b0e897091f8aeec745661ac1753d
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 Aug 8, 2018 — forked from JohannesHoppe/settings.json
VSCode: proxy settings
View settings.json
// 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
}
View Effective_Engineer.md

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 Jun 28, 2018 — forked from korakot/colab_download.py
Google colab file upload/download
View colab_download.py
files.download('example.txt') # from colab to browser download
@h4ck4life
h4ck4life / build.gradle
Created Jun 20, 2018 — forked from gpeal/build.gradle
Airbnb Gradle Flavors
View build.gradle
...
apply from: './flavors.gradle'
...
android {
buildTypes {
productFlavors {
project.flavors.each { flavor, config ->
"$flavor" {
dimension 'scope'
if (flavor != 'full') {
@h4ck4life
h4ck4life / RoundDemo.java
Created Jun 11, 2018
Rounding to the nearest 5 cents
View RoundDemo.java
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Arrays;
public class RoundDemo {
public static void main(String[] args) {
for (int n : Arrays.asList(
8201,
@h4ck4life
h4ck4life / grep.sh
Created Jun 9, 2018
grep cheat sheet
View grep.sh
#!/bin/sh
#http://www.thegeekstuff.com/2011/01/advanced-regular-expressions-in-grep-command-with-10-examples-%E2%80%93-part-ii/
# GENERAL
# print lines begining with range of letters
grep ^[A-D] table.txt
# REGEX
You can’t perform that action at this time.