Skip to content

Instantly share code, notes, and snippets.

View iToto's full-sized avatar
:octocat:
Helping to improve IAM @ GitHub

Salvatore D'Agostino iToto

:octocat:
Helping to improve IAM @ GitHub
View GitHub Profile

Keybase proof

I hereby claim:

  • I am itoto on github.
  • I am itoto (https://keybase.io/itoto) on keybase.
  • I have a public key ASA8TdFHKv9o9bMnOOLMu_Yt5V-vK2Qoo83wpNjKsDJUVQo

To claim this, I am signing this object:

@iToto
iToto / reset_routing_table.sh
Created December 7, 2016 05:11 — forked from midwire/reset_routing_table.sh
Reset routing table on OSX
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
<?php
class foo
{
public static function hello()
{
echo "Hello ";
}
public static function world()
@iToto
iToto / Swift iOS Platform Type
Last active August 29, 2015 14:28 — forked from khoogheem/Swift iOS Platform Type
Swift Version of getting the Device information... Tuple based.. provides Device type, description and optional version number
public class Diagnostics : NSObject {
//MARK: Device Platform
/** A String value of the device platform information */
private class var platform: String {
// Declare an array that can hold the bytes required to store `utsname`, initilized
// with zeros. We do this to get a chunk of memory that is freed upon return of
// the method
var sysInfo: [CChar] = Array(count: sizeof(utsname), repeatedValue: 0)
{
"folders": [
{
"follow_symlinks": true,
"path": "."
}
],
"build_systems": [
{
"name": "Xcode Build",
@iToto
iToto / createMongoReplicaSet.sh
Created July 29, 2014 02:44
Bash script to create a mongo Replica Set
#!/bin/bash
# This script will start three Mongo nodes as a replica set.
# NB: Be sure to create the log files and give write perms to the user
# One
mongod --port 27017 --dbpath /srv/mongodb/rs0-0 --replSet rs0 --smallfiles --oplogSize 128 --fork --logpath /var/log/mongo/27017
# Two
mongod --port 27018 --dbpath /srv/mongodb/rs0-1 --replSet rs1 --smallfiles --oplogSize 128 --fork --logpath /var/log/mongo/27018

About This File

This file will be used whenever a deployment failed and we need to make a git commit in order to attempt to re-deploy the application.

Usage:

Simply add a new line to this file with your name and commit it.

@iToto
iToto / handleColision.java
Created November 22, 2013 01:23
collisionDetection
int i = 0;
int newIndex;
do{
++i;
newIndex = ((this.hv1+i)*this.hv2) % table.length;
}while(table[newIndex] != null);
// Insert at newIndex
@iToto
iToto / hanoi.cpp
Created October 30, 2013 01:13
Hanoi4
#include <iostream.h>
void restack(char source,char dest,char temp)
{
cout << source << " --> " << temp << endl;
cout << source << " --> " << dest << endl;
cout << temp << " --> " << dest << endl;
}
void Hanoi4(int nDisks, char source, char intermed1, char intermed2, char dest)
@iToto
iToto / uuidSample.php
Created September 11, 2013 18:54
uuid json&msgpak sample
<?php
Route::get('uuid/{uuid}',function($uuid){
echo "UUID: $uuid \n";
$array = array(
'UUID' => $uuid
);
echo "Original Array:\n";
var_dump($array);
echo "JSON:\n";
var_dump(json_encode($array));