Skip to content

Instantly share code, notes, and snippets.

View lordhasyim's full-sized avatar
🏠
Working from home

ahmadhasyim lordhasyim

🏠
Working from home
View GitHub Profile
@lordhasyim
lordhasyim / Classes.php
Created January 10, 2019 04:29 — forked from altayalp/Classes.php
Php facade design pattern simple and complete example with dependency injection
<?php
class Validate implements ValidateInterface
{
public function isValid(array $data)
{
return true;
}
}
class Auth implements AuthInterface
@lordhasyim
lordhasyim / sources.list
Created December 3, 2018 03:39
Ubuntu 18.04 Bionic default /etc/apt/sources.list
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@lordhasyim
lordhasyim / Click to Tweet TinyMCE 4 Plugin
Created September 5, 2018 07:51 — forked from rsiddle/Click to Tweet TinyMCE 4 Plugin
A simple TinyMCE 4 plugin to add Click to Tweet HTML to your site.
<script type="text/javascript">
// Notes: Change @yourname to become your Twitter name.
tinymce.PluginManager.add('tweet', function(editor, url) {
// Adds a menu item to the tools menu
editor.addMenuItem('tweet', {
text: 'Tweet This',
context: 'insert',
onclick: function() {
editor.windowManager.open({
title: 'Tweet This',
(function() {
tinymce.PluginManager.add('custom_tinymce_plugin', function(editor,url) {
editor.addButton('custom_tinymce_plugin', {
title: 'Custom TinyMCE Plugin',
icon: 'bold',
onclick: function() {
editor.insertContent('Button clicked!');
}
})
});
<?php
/**
* Created by PhpStorm.
* User: recai.cansiz
* Date: 19.09.2017
* Time: 10:44
*
* @param array $inputs
* @param array|null $excepts
*
<?php
/**
* @author Mike Cochrane <mikec@mikenz.geek.nz>
* @author Nick Pope <nick@nickpope.me.uk>
* @copyright Copyright © 2010, Mike Cochrane, Nick Pope
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2.0
* @package Twitter
*/
/**
@lordhasyim
lordhasyim / convert_ascii.php
Created August 2, 2018 06:47 — forked from jaywilliams/convert_ascii.php
This simple function will remove any non-ASCII character. Feel free to fork and extend!
<?php
/**
* Remove any non-ASCII characters and convert known non-ASCII characters
* to their ASCII equivalents, if possible.
*
* @param string $string
* @return string $string
* @author Jay Williams <myd3.com>
* @license MIT License
* @link http://gist.github.com/119517
@lordhasyim
lordhasyim / launcher.sh
Created August 1, 2018 09:06 — forked from robertoestivill/launcher.sh
Bash alternative to Franz
#!/bin/bash
open -a "Google Chrome" --new --args --new-window \
'https://tweetdeck.twitter.com' \
'https://web.whatsapp.com' \
'https://blastersystems.slack.com/' \
'https://www.messenger.com/' \
'https://web.telegram.org/' \
'https://web.skype.com' \
'https://hangouts.google.com/' \

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@lordhasyim
lordhasyim / gist:2e3bca990693f827d58f579a3e06c05b
Created May 25, 2018 13:32
Sample callback for Infinite Scroll + Google Analytics
var $container = $('#container');
$container.infinitescroll({
// all your infinite scroll options
}, function(newElems) {
var opts = $container.data('infinitescroll'),
url = opts.path.join('') + opts.state.currPage;
// Call analytics