Skip to content

Instantly share code, notes, and snippets.

Alexandru Guzinschi vimishor

  • Romania
Block or report user

Report or block vimishor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View crash.zig
pub const Box = struct {
field: i32,
};
pub fn main() void {
var box = Box { .field = 0 };
box.*.field = 1; // crash aici
var boxPtr = &box;
View bitbucket-deploy-key.sh
#!/usr/bin/env bash
#
# Register a new deploy-key on Bitbucket
#
# Usage: ./bitbucket-deploy-key.sh <username> <password> key-test ~/.ssh/id_rsa.pub vimishor my-super-repo
#
USERNAME=$1
PASSWORD=$2
@vimishor
vimishor / packagist-search.sh
Created Apr 29, 2015
Search packagist.org from CLI
View packagist-search.sh
#!/usr/bin/env sh
#
# Search packagist.org from CLI with support for sorting results by the number
# of downloads or favorites.
#
# Temporary solution for https://github.com/composer/packagist/issues/365
#
# Dependencies:
# - [curl](http://curl.haxx.se/)
# - [jq](http://stedolan.github.io/jq/)
@vimishor
vimishor / pre-commit
Created Apr 14, 2015
Prevents debug traces and sensitive data to be commited.
View pre-commit
#!/bin/sh
#
# Prevents debug traces and sensitive data to be commited.
#
# What to search for
FUNCTIONS='var_dump\(|phpinfo\(|print_r\('
# Prevent the commit if something is found.
# default: true
View build-zsh.sh
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
@vimishor
vimishor / 503.html
Last active Dec 31, 2015
Custom 503 page while deploy on openshift | License: MIT
View 503.html
<!DOCTYPE html>
<html>
<head>
<title>Deploy in progress. Please try again in few minutes</title>
<style type="text/css" />
body {color: #666; text-align: center; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; sans-serif; margin:0; width: 800px; margin: auto; font-size: 14px; }
h1 { font-size: 56px; line-height: 100px; font-weight: normal; color: #456; }
h2 { font-size: 24px; color: #666; line-height: 1.5em; }
h3 { color: #456; font-size: 20px; font-weight: normal; line-height: 28px; }
hr { margin: 18px 0; border: 0; border-top: 1px solid #EEE; border-bottom: 1px solid white; }
View FooController.php
<?php
// src/Foobar/Controller/FooController.php
namespace Foobar\Controller;
class FooController
{
public function helloAction($request)
{
@vimishor
vimishor / skype.bash
Created Jul 14, 2013
Skype install on ubuntu
View skype.bash
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update
sudo apt-get install skype && sudo apt-get -f install
@vimishor
vimishor / gist:5950053
Last active Dec 19, 2015
Take notes inside your browser, with Sublime Text flavor.
View gist:5950053
// paste in address bar
data:text/html,<title>Browser Editor</title><style type="text/css">#e{font-size: 16px; position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");</script>
View problema_2.md

Există greșeli în următorul cod ?

function valid_email($email) {
    //Regular expression string to evaluate the email
    $regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/';

    //Checks for a match to the expression
    if (preg_match($regex, $email)) {
                //Check for valid domain(helps avoid eronious emails)
You can’t perform that action at this time.