Skip to content

Instantly share code, notes, and snippets.

@ovidiucs
ovidiucs / .screenrc
Last active August 29, 2015 14:00
screenrc
escape ^A^A
term screen-256color
vbell off
startup_message off
defscrollback 10000
hardstatus off
hardstatus alwayslastline
# hardstatus string "%{kG}%50>%-w%{ky}%n %t%{-}%+w%{-} %>%=%{ky}Ctrl-A ?%{-} for help"
#hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'
hardstatus string '%{= kG}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W} %c %{g}]'
var myClosure = function() {
var date = new Date();
var nested = function() {
return date.getMilliseconds();
};
return {
foo: nested
};
};
// Wanted to check out the example from Frontend Masters by David Crockford
var template = '<table border="{border}">' + //
'<tr><th>Last</th><td>{last}</td></tr>' + // Hold table format in var template
'<tr><th>First</th><td>{first}</td></tr>' + //
'</table>'; //
var data = { // values to be replaced with RegEx
first: "Carl", //
last: "Jose", //
@ovidiucs
ovidiucs / email-when-disk-is-below-limit.sh
Created October 4, 2012 18:49 — forked from scorpio2k2/gist:3835412
Send email to when disk is below a limit
#!/bin/sh
#The limit is 30% now
limit=10
mail=contact@debian-tutorials.com
tmp_file=/tmp/diskusage
hostname=`hostname`
#Now the script will calculate the current disk usage
disk=$(df -h | awk 'FNR == 2 {print $5}' | sed 's/%//')
@ovidiucs
ovidiucs / array-of-strings.c
Created September 23, 2012 20:41
Pointer Offset and Subscript Operator Syntax
#include<stdio.h>
#include<strings.h>
int main(void)
{
/* Looping Variables */
int i = 0, j = 0;
int num_states = 4;
char *states[]= {"California","Oregon","Washington","Texas"};