Skip to content

Instantly share code, notes, and snippets.

View bigmeech's full-sized avatar
🏀
Focusing

LE bigmeech

🏀
Focusing
  • United Kingdom
View GitHub Profile
@bigmeech
bigmeech / javadiagonals.java
Last active March 2, 2016 11:45
gets primary and secondary array
import java.util.Arrays;
class Main {
private static int[][] twoDInput = {
{1,2,3},
{4,5,6},
{7,8,9}
};
public static void main(String[] args) {
function pairWise(list){
list.sort(function(a,b){
return a - b;
})
.forEach(function(num, index, listArray){
for(var i = 0;i < listArray.length; i++){
var result = num * listArray[i]
console.log(result,"=>", num,"X", listArray[i])
}
})
@bigmeech
bigmeech / Castle.xml
Created July 3, 2016 13:01 — forked from bemasher/Castle.xml
Example of parsing xml in golang.
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
function fizzbuzz(start, end){
for(start; start < end; start++){
var isFizz = !!!(start % 3);
var isBuzz = !!!(start % 5);
var isFizzBuzz = isFizz && isBuzz;
if(isFizzBuzz) {
console.log("FizzBuzz");
continue
}
else if(isBuzz){
I am trying to retrieve something from localstorage but would use that to decide what is served,
so until that happens execution cannot continue.
I feel I am doing something wrong as the getKey property of the LocalStorage retunrs a promise
import { Component, ViewChild } from '@angular/core';
import { ionicBootstrap, Platform, Nav, LocalStorage , Storage } from 'ionic-angular';
import { StatusBar, Splashscreen, Push } from 'ionic-native';
@bigmeech
bigmeech / build_electron_properly.md
Created October 4, 2016 21:46
command to run electron build.

Electron's version.

export npm_config_target=1.2.3

The architecture of Electron, can be ia32 or x64.

export npm_config_arch=x64 export npm_config_target_arch=x64

Download headers for Electron.

export npm_config_disturl=https://atom.io/download/atom-shell

Tell node-pre-gyp that we are building for Electron.

export npm_config_runtime=electron

Tell node-pre-gyp to build module from source code.

@bigmeech
bigmeech / git-http-proto.txt
Created October 8, 2016 15:38 — forked from schacon/git-http-proto.txt
Git HTTP transport protocol documentation
HTTP transfer protocols
=======================
Git supports two HTTP based transfer protocols. A "dumb" protocol
which requires only a standard HTTP server on the server end of the
connection, and a "smart" protocol which requires a Git aware CGI
(or server module). This document describes both protocols.
As a design feature smart clients can automatically upgrade "dumb"
protocol URLs to smart URLs. This permits all users to have the
@bigmeech
bigmeech / pktline-format.txt
Last active October 8, 2016 21:28
git packet line format
pkt-line = data-pkt / flush-pkt
data-pkt = pkt-len pkt-payload
pkt-len = 4*(HEXDIG)
pkt-payload = (pkt-len - 4)*(OCTET)
flush-pkt = "0000"
function Harvester(options){
const socket = new net.Socket();
socket.connect({port:options.port, host:options.host}, ()=>{
socket.write(`+node|${options.node}\r\n`);
});
socket.on('connect', (socket) => console.log('Connected to Log Harvester!'));
socket.on('data', (data) => console.log('Message from Logio Server: ', data));
socket.on('error', (error) => console.log('Error from Logio Server: ', error.message));
socket.on('close', (error) => {
console.log(!error ? 'Client connection closed' : 'Client connection closed with Error');
object UnifiedTypes extends App {
val set = new scala.collection.mutable.LinkedHashSet[Any]
set += "This is a string" // add a string
set += 732 // add a number
set += 'c' // add a character
set += true // add a boolean value
set += main _ // add the main function
val iter: Iterator[Any] = set.iterator
while (iter.hasNext) {
println(iter.next.toString())