Skip to content

Instantly share code, notes, and snippets.

View ryzokuken's full-sized avatar
⚔️
Fighting the borrow checker

Ujjwal Sharma ryzokuken

⚔️
Fighting the borrow checker
View GitHub Profile
@ryzokuken
ryzokuken / save.rb
Created September 23, 2015 10:23
Save: Save notes on the go
# Save.rb : Ujjwal Sharma and Kush Bansal
class Note
attr_reader :text, :title, :color
def initialize(text,title,color)
@text = text
@title = title
@color = color
end
def marshal_dump
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool exists(vector <int> a, int val) {
if(find(a.begin(), a.end(), val) != a.end())
return true;
return false;
@ryzokuken
ryzokuken / maxfive.c
Last active October 23, 2016 12:04
Finds the sum of five maximum numbers in a 3x3 matrix and print the output to STDOUT
/***************************************************************
* maxfive.c : Ujjwal Sharma *
* This program finds the five maximum numbers *
* in a 3x3 matrix and prints its sum to STDOUT *
***************************************************************/
#include <stdio.h>
int main() {
int elems = 0, i, j, max[5], sum = 0; /* elems is the number of elements in the max array */
#include <stdio.h>
void printArray(int array[], int length) {
int i;
for (i = 0; i < length; i++) {
printf("%d ", array[i]);
}
printf("\n");
}
#include <stdio.h>
struct Time {
int hours;
int minutes;
int seconds;
};
struct Runner {
char name[20];
{
"nodes": [
{"id": "Myriel", "group": 1},
{"id": "Napoleon", "group": 1},
{"id": "Mlle.Baptistine", "group": 1},
{"id": "Mme.Magloire", "group": 1},
{"id": "CountessdeLo", "group": 1},
{"id": "Geborand", "group": 1},
{"id": "Champtercier", "group": 1},
{"id": "Cravatte", "group": 1},
struct Complex {
int real;
int imaginary;
}
struct Complex addComplex(struct Complex* a, struct Complex* b) {
struct Complex c;
c.real = a->real + b->real;
c.imaginary = a->imaginary + b->imaginary;
return c;
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
➜ ~ sudo pacman-mirrors -g
.: Info ping google.com x 1
.: Info ping repo.manjaro.org x 1
.: Info Downloading mirrors from repo.manjaro.org
.: Info Using default mirror file
.: Info Querying mirrors - This may take some time
1.050 Australia : http://mirror.ventraip.net.au/Manjaro/
1.339 Australia : http://manjaro.uberglobalmirror.com/
1.567 Australia : http://manjaro.mirror.serversaustralia.com.au/
1.362 Austria : http://mirror.inode.at/manjaro/