Skip to content

Instantly share code, notes, and snippets.

View od3n's full-sized avatar
🎯
Focusing

Salahuddin Hairai od3n

🎯
Focusing
View GitHub Profile
@math2001
math2001 / Revert sublime text 3 to a fresh state.md
Last active March 21, 2024 13:34
Revert Sublime Text 3 to a fresh state step by step 🙂

[UPDATE] Sublime Text 4

If you have the latest sublime text (version 4), you can just do:

subl --safe-mode

How do I revert Sublime Text 3 to a fresh state

@nasrulhazim
nasrulhazim / get-all-public-holidays-for-malaysia-states.md
Last active October 4, 2023 08:08
Get All Public Holidays for Malaysia States

Get All Public Holidays for Malaysia States

Installation

  1. Install PhantomJs
    • For Ubuntu 16.04, click here
  2. Install CasperJS
    • install globally: npm install -g casperjs

Usage

@dhoeric
dhoeric / Ubuntu 16.04
Last active February 27, 2025 23:01
install-docker-aws-ec2-user-data
#!/bin/bash
# Install docker
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update
@g0ld3lux
g0ld3lux / docker-compose.yml
Created November 27, 2016 07:37
Scaling Out Laravel with Docker
haproxy:
image: interaction/haproxy:master
links:
- letsencrypt
- web
ports:
- "80:80"
- "443:443"
volumes_from:
- letsencrypt
@nasrulhazim
nasrulhazim / software-development-learning-curve-guidelines.md
Created November 23, 2016 08:17
Software Development Learning Curve Guidelines

Software Development Learning Curve Guidelines

Target Platform

  1. Web Applications
  2. Mobile Applications
  3. Desktop Applications

Tools & Environments

@eyaltrabelsi
eyaltrabelsi / query redshift from bash
Created October 30, 2016 12:29
query redshift from bash using psql
$ export AWS_ACCESS_KEY=<ENTER ACCESS KEY>
$ export SECRET_ACCESS_KEY=<ENTER SECRET ACCESS KEY>
$ psql -h <redshift-host> -p <redshift-port> -d default -U <redshift-user> -c <redshift-query>
function process($root, $path, $moduleName, $folder) {
$file = get-content (join-path $root $path)
$list = @{};
$item = $null
foreach($line in $file) {
if ($line -match "\.(controller|factory|service)\('(\w+)" -and $Matches[2]) {
$item = $Matches[2]
$list[$item] += @($line -replace '^\s+', "angular.module('$moduleName')`n")
} else {
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
{
return $next($request);
}
@cviebrock
cviebrock / ElasticLoggingProvider.php
Created September 29, 2016 14:57
Log Laravel to Elastic/Logstash
<?php namespace App\Providers;
use Elastica\Client;
use Illuminate\Support\ServiceProvider;
use Monolog\Formatter\LogstashFormatter;
use Monolog\Handler\ElasticSearchHandler;
class ElasticLoggingProvider extends ServiceProvider
{
@adamwathan
adamwathan / troubleshooting.md
Last active January 23, 2025 08:49
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart