Skip to content

Instantly share code, notes, and snippets.

View mul14's full-sized avatar
:octocat:
Preparing for big things...

Mulia Nasution mul14

:octocat:
Preparing for big things...
View GitHub Profile
@mul14
mul14 / smooth-animated-scrolling.js
Created September 10, 2016 23:29
Smooth animated scrolling with JavaScript
// URL: https://css-tricks.com/snippets/jquery/smooth-scrolling/#comment-1599892
$(document).on('click', 'a[href*="#"]:not([href="#"])', function(e) {
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
let target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
@mul14
mul14 / CatchAllOptionsRequestsProvider.php
Created September 2, 2016 11:35 — forked from danharper/CatchAllOptionsRequestsProvider.php
Lumen with CORS and OPTIONS requests
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@mul14
mul14 / Default (OSX).sublime-keymap
Created June 10, 2016 01:35
My Sublime Text 3 Configurations
[
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["super+v"], "command": "paste_and_indent" },
{"keys": ["super+\\"], "command": "toggle_side_bar"},
{"keys": ["shift+super+n"], "command": "advanced_new_file_new"},
{"keys": ["shift+5"], "command": "move_to", "args": {"to": "brackets"} },
{"keys": ["ctrl+\\"], "command": "toggle_side_bar"},
{"keys": ["super+shift+space"], "command": "expand_region"},
{"keys": ["option+up"], "command": "expand_region"},
{"keys": ["option+down"], "command": "expand_region", "args": {"undo": true }, "context": [{"key": "expand_region_soft_undo"}] },
@mul14
mul14 / origin_monitor.py
Created May 19, 2016 04:51 — forked from SliceOLife/origin_monitor.py
Checks Origin's on the House page for free games.
import requests
import bs4
from termcolor import colored
root_url = 'https://www.origin.com/en-gb/store/free-games/on-the-house'
def getFreeGames():
try:
response = requests.get(root_url)
soup = bs4.BeautifulSoup(response.text)
@mul14
mul14 / meta-tags.md
Created March 21, 2016 10:40 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@mul14
mul14 / laravel-new.sh
Last active March 19, 2016 09:40
Simple script to create Laravel project and cd into target directory. Put this script in your bashrc or zshrc file.
laravel-new() {
if [ -z "$1" ]; then
cat << EOF
Please provide a directory name.
Usage:
laravel-new [directory-name]
EOF
return;
@mul14
mul14 / upgrade-everything.sh
Created February 21, 2016 13:19
Upgrade Everything
#!/usr/bin/env sh
sh $HOME/.oh-my-zsh/tools/upgrade.sh
pip3 install --upgrade pip
pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
pip2 install --upgrade pip
pip2 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip2 install -U
@mul14
mul14 / VideoStream.php
Created December 31, 2015 07:32 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@mul14
mul14 / README.md
Created December 11, 2015 06:11 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and cli-links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
@mul14
mul14 / facebook-video-regex
Created December 6, 2015 05:55
Facebook Video URL Regex
http://regexr.com/3cbrm
^http(?:s?):\/\/(?:www\.|web\.|m\.)?facebook\.com\/([A-z0-9\.]+)\/videos(?:\/[0-9A-z].+)?\/(\d+)(?:.+)?$