Skip to content

Instantly share code, notes, and snippets.

iammart

Block or report user

Report or block iammart

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
@iammart
iammart / media-queries-b3.scss
Created Jul 17, 2018 — forked from akolinski/media-queries-b3.scss
Media queries using SCSS in Bootstrap 3
View media-queries-b3.scss
// Using bootstrap the SASS way. Import your variables.
@import "bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/variables";
/* http://getbootstrap.com/css/#responsive-utilities */
/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */
// Mobile first
body{
border: solid 4px red;
@iammart
iammart / BaseActivity.java
Created Jun 15, 2018 — forked from kshivang/BaseActivity.java
Instagram like ViewPager implementation with bottom tab layout, without recreating fragments in fragment manager on tab select or back click. Implementation is prescribed for ViewPager inside fragment(more complex case) similar thing could be achieved for ViewPager in activity as well.
View BaseActivity.java
public abstract class BaseActivity extends AppCompatActivity {
public void moveBack() {
super.onBackPressed();
}
public abstract void onBackWhenNoFragment();
@Override
public void onBackPressed() {
@iammart
iammart / ProfileActivity.java
Created Jun 1, 2018 — forked from xvarlez/ProfileActivity.java
Android simple user input validation system, with support for EditText, AutoCompleteTextView, TextInputLayout
View ProfileActivity.java
/**
* The activity containing your EditTexts.
*/
public class ProfileActivity extends AppCompatActivity {
/**
* Input field "your name".
*/
@Bind(R.id.edittext_name)
EditText nameEditText;
View Makefile
.PHONY: run
# certs and output
OUTPUT_FILE=apkname.apk
ALIAS=youralias
KEYPASS=yourkeypass
KEYSTORE=certs/yourcert.keystore
UNSIGNED=platforms/android/build/outputs/apk/android-release-unsigned.apk
# or, if you're using Crosswalk:
View how-to-add-image-to-gist.md

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh
@iammart
iammart / localhost-ssl.md
Created Nov 19, 2017 — forked from ethicka/localhost-ssl.md
Local virtualhost SSL websites on Mac OS Sierra
View localhost-ssl.md

Local virtualhost SSL websites on Mac OS Sierra

These instructions will guide you through the process of setting up a wildcard SSL for your local virtualhosts for offline development. Most importantly, this configuration will give you the happy, green lock in Chrome.

These instructions have only been tested on Mac OS Sierra using the pre-installed Apache and PHP versions. These instructions also assume you have virtualhosts set up locally already.


Configuring SSL

View _Laravel_Queue_Supervisor_Instruction.md

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

View fix-wordpress-permissions.sh
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@iammart
iammart / scripts.sh
Last active May 26, 2017
cPanel Mail
View scripts.sh
#
# Delete email older than %%
#
$ find /home/%ACCOUNT%/mail/%MAILBOX%/new -type f -mtime +30 -delete
$ find /home/%ACCOUNT%/mail/%MAILBOX%/cur -type f -mtime +30 -delete
#
# Fix quotas
# https://forums.cpanel.net/threads/how-to-reset-mail-quota.105325/#post-691898
#
You can’t perform that action at this time.