Skip to content

Instantly share code, notes, and snippets.

View juriansluiman's full-sized avatar

Jurian Sluiman juriansluiman

View GitHub Profile
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@EvanDotPro
EvanDotPro / gittyup.sh
Created December 21, 2011 17:15
Easily keep master in sync with upstream.
####################################################################################
## ##
## gittyup() - Easily keep master in sync with upstream. ##
## ##
## Author: Evan Coury, http://blog.evan.pro/ ##
## URL: https://gist.github.com/1506822 ##
## ##
## This bash function is a simple shortcut for keeping your local (and public ##
## fork / origin remote) master branch up to date and in sync with the upstream ##
## master. To use gittyup(), simply drop this in your ~/.bashrc. ##
@iiska
iiska / Autostart.sh
Created January 9, 2012 14:05
Using KWallet and ksshaskpass with ssh-agent
#! /bin/bash
# Put this in ~/.kde/Autostart/ssh-agent.sh
export SSH_ASKPASS=/usr/bin/ksshaskpass
/usr/bin/ssh-add
@Ocramius
Ocramius / bootstrap.php
Created June 3, 2012 13:33
Setting up Doctrine DBAL to use UTF-8 in MySQL connections
<?php
use Doctrine\DBAL\Event\Listeners\MysqlSessionInit;
/* ... */
if(
isset($options['encoding'])
&& $this->_em->getConnection()->getDriver() instanceof MysqlDriver
) {
$this
/**
* Handles errors during dispatch
*
* @param \Zend\Mvc\MvcEvent $e
*/
public function onDispatchError(MvcEvent $e)
{
$exception = $e->getParam('exception');
// Not an exception causing this.
@Hounddog
Hounddog / CopyPropertyTask.php
Created September 27, 2012 09:16
Phing Task to copy files if the properties change
<?php
/**
* V5
* LICENSE
*
* Insert License here
*
* @category Phing
* @package CopyPropertyTask
* @copyright Copyright (c) 2012 Doyousoft
@bretwalker
bretwalker / ssl_validator.py
Last active January 28, 2024 12:02
A Python script that uses M2Crypto to check the validity of an SSL certificate.
from M2Crypto import SSL
from M2Crypto.SSL.Checker import SSLVerificationError, NoCertificate, WrongCertificate, WrongHost
import socket, re
from datetime import datetime
import pytz
class ValidationResults:
def __init__(self):
self.connection_error = False
@Ocramius
Ocramius / SchemaValidityFunctionalTest.php
Created April 22, 2013 11:48
Functional test case for schema validation in Doctrine2 ORM
<?php
namespace Ocramius\CMS\ContentTest;
use Ocramius\CMS\ContentTest\Util\ServiceManagerFactory;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\ORM\Tools\SchemaValidator;
use PHPUnit_Framework_TestCase;
/**
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;