Skip to content

Instantly share code, notes, and snippets.

use strict;
use warnings;
use v5.18;
my %anagrams;
sub anagram {
my ( $word ) = @_;
my @letters = sort split //, $word;
$anagrams{"@letters"};
}
#-------------------------------------------------
#
# Project created by QtCreator 2014-08-26T10:07:27
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
@mixin abs-pos($top:auto,$left:auto,$bottom:auto,$right:auto) {
position:absolute;
top: #{$top}px;
bottom:$bottom;
left:$left;
right:$right;
}
.test {
@include abs-pos($top:10,$left:10);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>index</title>
</head>
<body>
<p></p>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
@ynonp
ynonp / demo1.pl
Created June 26, 2014 15:38
perl method signatures
use v5.20;
use feature 'signatures';
no warnings 'experimental::signatures';
sub plus($x, $y) {
$x + $y
}
say plus(2,3);
@ynonp
ynonp / 05 Critter.pm
Last active August 29, 2015 13:56
References examples and syntax
# Critter.pm
#
package Critter;
use strict;
use warnings;
use v5.14;
sub new {
my ( $cls, $name, $age ) = @_;

Unix Scripting Lab - Solutions

Part 1: Welcome to Unix

  1. Login to your Unix account
  2. Find your current shell, the default shell and a list of all installed shells.
  • current shell: echo $0
  • default shell: echo $SHELL
  • all shells: cat /etc/shells
@ynonp
ynonp / lab01.md
Last active November 15, 2022 09:43

Part 1: Welcome to Unix

  1. Login to your Unix account
  2. Find your current shell, the default shell and a list of all installed shells.
  3. List all files and directories in /etc folder ordered by size (hint: man ls).
  4. Print the current date and time formatted as follows:
    Sun 21/03/2010, 14:30 (hint: man date)

Unix Commands Summary

@ynonp
ynonp / main.cpp
Created December 27, 2013 15:14
QProcess output example
#include <QCoreApplication>
#include <QtCore/QtCore>
#include "monitor.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QProcess p;
p.start("/bin/ls");
<!DOCTYPE html>
<html ng-app="Intro">
<head>
<title>Hello Angular</title>
<style>
body {
font-size: 2em;
}