Skip to content

Instantly share code, notes, and snippets.

@fabriziobagala
fabriziobagala / PermCheck.cs
Created May 25, 2019
Check whether array A is a permutation.
View PermCheck.cs
using System;
using System.Collections.Generic;
class Solution
{
public int solution(int[] A)
{
HashSet<int> distinct = new HashSet<int>();
int max = 0;
@GDog1985
GDog1985 / install_mineos-node
Last active May 25, 2019 — forked from hexparrot/install_mineos-node
Downloads, installs and configures components required for the MineOS Web User Interface on apt-get based systems using systemd.
View install_mineos-node
#!/bin/sh
# update repositories
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get update
# download the necessary prerequisite components for mineos
apt-get -y install -y nodejs git rdiff-backup screen build-essential openjdk-8-jre-headless
# download the most recent mineos web-ui files from github
View CartItem.cs
public class CartItem
{
public int ProductId { get; set; }
public string Username { get; set; }
public int Count { get; set; }
}
@GDog1985
GDog1985 / install_mineos-node
Created May 25, 2019 — forked from hexparrot/install_mineos-node
Downloads, installs and configures components required for the MineOS Web User Interface on rpm based systems using systemd.
View install_mineos-node
#!/bin/sh
# update repositories
#yum update
# download the necessary prerequisite components for mineos
curl -sL https://rpm.nodesource.com/setup_8.x | bash -
yum -y install screen git wget java-1.8.0-openjdk-headless.x86_64 openssl openssl-devel
yum -y groupinstall "Development tools"
yum -y install nodejs
View untrusted-lvl15-solution.js
/**************************
* exceptionalCrossing.js *
**************************
*
* Sorry, old friend, but I'm afraid I can't share
* co-authorship on this paper. You've done a very
* good job getting this Algorithm for me. The bit
* with the keys was especially clever! I wouldn't
* have thought of it myself. But then, of course,
* that's why you were here in the first place.
@rig8f
rig8f / nbformat
Created May 25, 2019
A Python 3 script to format Colab / Jupyter notebooks
View nbformat
#!/usr/bin/python3
# Colab/Jupyter/IPython notebooks formatter
# Can fix indentation and clear cells' output, useful for readability and versioning
# MIT License - Copyright (C) 2019 Filippo Rigotto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@lesarrow
lesarrow / baseball_quiz_questions.md
Created May 25, 2019
Baseball Quiz Questions for my quiz app
View baseball_quiz_questions.md

Question 1: If you were scoring a baseball game with pen and paper and wrote 6-3 after a play, what does that mean? Correct: An out, Shortstop to First Base Wrong: The score is Visitors 6 and Home Team 3 Wrong: The score is Home Team 6 and Visitors 3 Wrong: An out, First Base to Shortstop

Question 2: The Designated Hitter rule is used only in the ______ Correct: American League Wrong: National League Wrong: 9th Inning

View untrusted-lvl14-solution.js
/********************
* crispsContest.js *
********************
*
* The Algorithm is almost in our grasp!
* At long last, we will definitively establish
* that 3SAT is solvable in polynomial time. It's
* been a long, strange journey, but it will all be
* worth it.
*
@robin-a-meade
robin-a-meade / vpn-indicator-shell-extension.patch
Created May 25, 2019
Patch: make vpn-indicator-shell-extension work for SNX
View vpn-indicator-shell-extension.patch
index 2dfed8b..d688227 100644
--- a/extension.js
+++ b/extension.js
@@ -23,7 +23,7 @@ const VpnIndicator = new Lang.Class({
},
_checkVPN: function() {
- let [res, out, err, exit] = GLib.spawn_sync(null, ["/bin/bash", "-c", "ifconfig -a | grep tun0"], null, GLib.SpawnFlags.SEARCH_PATH, null);
+ let [res, out, err, exit] = GLib.spawn_sync(null, ["ip", "link", "show", "tunsnx"], null, GLib.SpawnFlags.SEARCH_PATH, null);
View linux.howto.md

link a folder

$ ln -s ~/Documents/dev ~/dev

find a file

You can’t perform that action at this time.