Skip to content

Instantly share code, notes, and snippets.

View ivanelianto's full-sized avatar
💭
Mistaker

Ivan Elianto ivanelianto

💭
Mistaker
  • Pontianak, Kalimantan Barat, Indonesia
View GitHub Profile
@ivanelianto
ivanelianto / RandomSlide.vba
Last active December 1, 2019 08:20
Random Power Point Slide Without Repetition
Dim NotShownSlideIndexes As New Collection
Dim HasStarted As Boolean
Sub OnSlideShowPageChange()
If HasStarted = False Then
HasStarted = True
Set NotShownSlideIndexes = Nothing
For Each Slide In ActivePresentation.Slides
With Slide.Shapes(2).ActionSettings(ppMouseClick)
@ivanelianto
ivanelianto / download-drama-day.py
Last active November 13, 2019 12:56
Not working anymore after patch in the website.
'''
NOT WORKING ANYMORE. THE WEBSITE HAS BEEN PATCHED.
'''
import requests
from bs4 import BeautifulSoup
import webbrowser as wb
import itertools
print 'Please wait'
@jeffochoa
jeffochoa / Response.php
Last active May 22, 2024 04:06
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@shettayyy
shettayyy / pre-commit-eslint
Last active December 10, 2021 05:27
Pre-commit hook for Linting JS with ESLint before commit.
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@bkno
bkno / Debug eloquent queries in Laravel 5.php
Created February 19, 2016 12:00
Debug eloquent queries in Laravel 5
<?php
use DB;
DB::enableQueryLog();
// execute queries here
dd(DB::getQueryLog());
@singhabhinav
singhabhinav / gist:132b8196abac026b43fa
Last active April 14, 2023 12:44
Install SSL certificate in Nginx (Using .crt & .ca-bundle certificate files)
Step 1 - Create .crt file
cat domainname.crt domainname.ca-bundle > domainname-ssl-bundle.crt
Step 2-
Add lines for ssl_certificate in nginx configuration
server {
listen 80 default_server;
@egel
egel / auto-remove-sublime-license-popup
Last active April 8, 2024 23:00
Auto-remove Sublime's license popup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)