Skip to content

Instantly share code, notes, and snippets.

@isurum
isurum / debug_certificate
Created August 20, 2017 15:57
Get the Debug Certificate in Mac/Linux.
keytool -exportcert -list –v -alias androiddebugkey -keystore ~/.android/debug.keystore
@isurum
isurum / keytool
Created August 20, 2017 15:53
Get the Debug Certificate for Android Development
keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
@isurum
isurum / ProductsController.php
Created July 18, 2017 12:33
Laravel 5.4 Bootstrap row class for every 3 columns - Blade Template
public function showProducts(){
$products = DB::table('products')->paginate(9);
return view('products', ['products' => $products]);
}
@isurum
isurum / BinarySearch.java
Created June 22, 2017 11:30
Binary Search Implementation Using Java
package uk.co.stableweb;
public class BinarySearch {
public static void main(String[] args) {
// Create an array
int[] array = {1, 3, 5, 7, 9, 11, 15, 17, 19};
// Initially lowest index is 0
int lowestIndex = 0;
@isurum
isurum / binary_search.py
Created June 22, 2017 09:22
Binary Search implementation using Python.
def search(arr, x, lowest_index, highest_index):
#find the middle index
middle_index = lowest_index + (highest_index - lowest_index) / 2
print "Middle index is ", middle_index
# checks whether the value is in the middle index
if (arr[middle_index] == x):
return middle_index
elif (arr[middle_index] > x):
# checks in <- direction
@isurum
isurum / pysysinfo_func.py
Last active June 16, 2017 11:57
Python system info script using functions
#!/usr/bin/env python
#A System Information Gathering Script
import subprocess
#Command 1
def uname_func():
uname = "uname"
uname_arg = "-a"
print "Gathering system information with %s command:\n" % uname
@isurum
isurum / pysysinfo.py
Created June 16, 2017 09:56
A System Information Gathering Script Using Python
#!/usr/bin/env python
#A System Information Gathering Script
import subprocess
#Command 1
uname = “uname”
uname_arg = “-a”
print "Gathering system information with %s command:\n" % uname
@isurum
isurum / web.php
Last active June 16, 2017 15:58
Regular Expression Route Constraints And Names in Laravel web.php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
@isurum
isurum / HelloWorld.java
Created April 7, 2017 11:21
It's a convention to start learning and teaching a programming language using Hello World program.
package uk.co.stableweb;
public class HelloWord {
/**
* Launch the application.
*/
public static void main(String[] args) {
System.out.println("Hello World");
}