Skip to content

Instantly share code, notes, and snippets.

View 64lines's full-sized avatar

Julian Alexander Murillo 64lines

  • Huge Inc.
  • Medellin - Colombia
View GitHub Profile
@64lines
64lines / foreach.js
Last active October 6, 2016 22:18
[JAVASCRIPT] - Functional For Each
var numbers = {one: 1, two: 2, three: 3, four: 4};
Object.keys(numbers).forEach(function(key){
var value = numbers[key];
doSomethingWith(value);
/* For example, key == "one" and value == 1 */
});
@64lines
64lines / Template.html
Created October 6, 2016 20:03
[HTML] - Blog Bootstrap Template with jQuery Included
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="http://getbootstrap.com/favicon.ico">
@64lines
64lines / tricks.txt
Created October 6, 2016 19:56
[GIST] - Tricks to search on Gist
keyword user:64lines
@64lines
64lines / git.sh
Created October 6, 2016 19:42
[GIT] - Change commit message and/or attach changes to the last commit
git commit --amend
@64lines
64lines / Permutation Algoritm.java
Last active October 6, 2016 19:30
[JAVA] - Integer Permutation Algoritm
public ArrayList<ArrayList<Integer>> permute(int[] num) {
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
//start from an empty list
result.add(new ArrayList<Integer>());
for (int i = 0; i < num.length; i++) {
//list of list in current iteration of the array num
ArrayList<ArrayList<Integer>> current = new ArrayList<ArrayList<Integer>>();
for (ArrayList<Integer> l : result) {
@64lines
64lines / Quicksort Algorithm.java
Last active October 6, 2016 19:28
[JAVA] - Quicksort Algorithm
public class QuickSort {
public static void main(String[] args) {
int[] x = { 9, 2, 4, 7, 3, 7, 10 };
System.out.println(Arrays.toString(x));
int low = 0;
int high = x.length - 1;
quickSort(x, low, high);
System.out.println(Arrays.toString(x));
@64lines
64lines / String_Array.java
Created October 6, 2016 19:23
[JAVA] - String/Array Useful Functions
toCharArray() //get char array of a String
charAt(int x) //get a char at the specific index
length() //string length
length //array size
substring(int beginIndex)
substring(int beginIndex, int endIndex)
Integer.valueOf()//string to integer
String.valueOf()/integer to string
Arrays.sort() //sort an array
Arrays.toString(char[] a) //convert to string
@64lines
64lines / Fibonacci Algorithm.java
Created October 6, 2016 19:20
[JAVA] - Fibonacci Algorithm
public static long fib(int n) {
if (n <= 1) return n;
else return fib(n-1) + fib(n-2);
}
@64lines
64lines / BinarySearch.java
Created October 6, 2016 19:17
[JAVA] - Binary Search Java 8
Arrays.binarySearch(Object[] a, Object key);
@64lines
64lines / ReadInputs.java
Last active January 24, 2017 02:44
[JAVA] - Using Scanner to Read System Inputs - Java Stdin and Stdout
import java.util.*;
Scanner scanner = new Scanner(System.in);
String myString = scanner.next();
int myInt = scanner.nextInt();
scanner.close();
System.out.println("myString is: " + myString);
System.out.println("myInt is: " + myInt);