Skip to content

Instantly share code, notes, and snippets.

View abranhe's full-sized avatar
🐂
Coding Furiously

Abraham abranhe

🐂
Coding Furiously
View GitHub Profile
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'publish' ]
2 info using npm@5.6.0
3 info using node@v8.11.2
4 verbose npm-session 147881e0f3e6c455
5 verbose publish [ '.' ]
6 info lifecycle clear@1.0.1~prepublish: clear@1.0.1
7 info lifecycle clear@1.0.1~prepare: clear@1.0.1
8 info lifecycle clear@1.0.1~prepublishOnly: clear@1.0.1
9 info lifecycle clear@1.0.1~prepack: clear@1.0.1
@abranhe
abranhe / abranhe.java
Last active July 24, 2018 04:30
Theme?
import com.abranhe.abranhe;
class Abranhe {
System.out.println("abranhe");
}
@abranhe
abranhe / Main.java
Last active September 4, 2018 20:16
Fibonacci
import java.lang.Math;
public class Main {
public static double inverseSqrt5 = 1 / Math.sqrt(5);
public static double phi = (1 + Math.sqrt(5)) / 2;
public static int fibonacci(int n) {
return (int)Math.floor(Math.pow(phi, n) * inverseSqrt5 + 0.5);
}
@abranhe
abranhe / newPage.js
Created September 17, 2018 17:45
New page on react
var PageOne = React.createClass({
_handlePress() {
this.props.navigator.push({id: 2,});
},
render() {
return (
<View style={[styles.container, {backgroundColor: 'green'}]}>
</View>
)
@abranhe
abranhe / vectors.cpp
Last active September 25, 2018 22:23
Collections using vectors.
// Run it online
// https://repl.it/@abranhe/Pluralsight-1-4-vectors
//
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
@abranhe
abranhe / VariableSizedArrays.cpp
Last active September 26, 2018 02:52
Variable Sized Arrays Hackerrank
// See question: https://hackerrank-challenge-pdfs.s3.amazonaws.com/14507-variable-sized-arrays-English?AWSAccessKeyId=AKIAJ4WZFDFQTZRGO3QA&Expires=1537933597&Signature=hih3xrYn04RUlnsFKRVP1%2BFTgWA%3D&response-content-disposition=inline%3B%20filename%3Dvariable-sized-arrays-English.pdf&response-content-type=application%2Fpdf
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
@abranhe
abranhe / auto.cpp
Last active September 26, 2018 03:23
Auto example in C++
// Author: Abraham (@abranhe)
// Run it: https://repl.it/@abranhe/AutoExample
// C++ 11 or later
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v = {0,1 ,2 ,3 ,4};
@abranhe
abranhe / simple_sort.cpp
Created September 27, 2018 19:46
Simple sort in C++
//
// Simple Sort
// Carlos Abraham He...
// github.com/abranhe
// https://repl.it/@abranhe/Simple-Sort
//
#include <iostream>
#include <vector>
#include <algorithm>
@abranhe
abranhe / reverse_array.cpp
Created September 28, 2018 03:05
Reverse items in array
//
// Reverse an array
// Carlos Abraham (abranhe.com)
// https://stackoverflow.com/questions/19712903/reverse-contents-in-array
//
#include <iostream>
#include <algorithm>
using namespace std;
int main()
#include <string>
#include "account.h"
using namespace std;
Account::Account(void):balance(0)
{
}
vector<string> Account::report()
{