Skip to content

Instantly share code, notes, and snippets.

View 1ik's full-sized avatar
🎯
Focusing

Anik Hasan 1ik

🎯
Focusing
View GitHub Profile
@1ik
1ik / README.md
Created February 8, 2018 16:10 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@1ik
1ik / upload_pub_key
Created April 29, 2017 16:43
Upload a new public key to a linux vps and enable ssh login
ssh-copy-id -i ~/.ssh/id_rsa.pub user@domain.com
@1ik
1ik / rebase
Created December 6, 2014 13:13
Git rebasing with other branch
1) get the latest code from the remote:
git fetch origin
2) check out the branch you would like to squash
git checkout task/user-add-feature
3) make sure your local copy is the same as the remote
git pull origin
4) make sure you have all the commits from the branch you split off from
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
@1ik
1ik / gist:7216442
Created October 29, 2013 15:08
JDBC sql (mysql & sqlite) large data insert snippet
public static void mysqlinserttest() throws SQLException{
Connection c = DB.getConnection();
c.setAutoCommit(false);
String insertTableSQL = "INSERT INTO test"
+ "(email , phone) VALUES"
+ "(?,?)";
PreparedStatement preparedStatement = c.prepareStatement(insertTableSQL);
for (int i =0; i<50000; i++) {
preparedStatement.setString(1, "email"+i);
preparedStatement.setString(2, "00000000"+i);
@1ik
1ik / index.php
Created August 16, 2013 14:48
Sending mail using swift mailer library
<?php
require_once 'swift/lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
->setUsername('gmailusername')
->setPassword('XXXXXXXXXX')
;
@1ik
1ik / connector.java
Created August 13, 2013 04:43
JDBC Connector class for java
package com.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
public class connector {
private static Connection conn=null;
@1ik
1ik / .htaccess
Created August 12, 2013 10:15
codeigniter .htaccess file to remove index.php from url. (works both in xampp and wampp)
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php/$1 [L]