This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/streadway/amqp" | |
"log" | |
"os" | |
"os/signal" | |
"syscall" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash |" Press <F1>, ? for help | |
# Author: Rahul Prasad (http://www.rahulprasad.com) |" No tags found. | |
# README |~ | |
# aws cli must be configured |~ | |
# for knife to work from other directory, copy .chef folder from chef-repo to the working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type node struct { | |
value string | |
expiry float64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionImage($id, $preset = 'original', $type='circuit') { | |
// If image exists in cache and its last modified date is same as circuit last modofied date // Load it | |
$model = $this->loadModel($id); | |
$modified_date = strtotime($model->update_time); | |
/*$a = filemtime("cache/circuits/circuit/{$preset}/{$model->id}.png"); | |
echo "$a"; | |
echo "$modified_date"; | |
exit;*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: openerp-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 | |
# Short-Description: OpenERP Server - the server | |
# Description: OpenERP is a complete ERP and CRM software | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function serverReachable() { | |
// IE vs. standard XHR creation | |
var x = new ( window.ActiveXObject || XMLHttpRequest )( "Microsoft.XMLHTTP" ), | |
s; | |
x.open( | |
// requesting the headers is faster, and just enough | |
"HEAD", | |
// append a random string to the current hostname, | |
// to make sure we're not hitting the cache | |
"//" + window.location.hostname + "/?rand=" + Math.random(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Set needToConfirm variable to true when you want to prevent closing. | |
For example: If you have made an http call to insert comment (You can set it as true untill you get a success or failure response) | |
*/ | |
var needToConfirm = true; | |
function confirmExit() { | |
if (needToConfirm) { | |
return 'Please while the comment is being uploaded.'; | |
} |
NewerOlder