Skip to content

Instantly share code, notes, and snippets.

View ismnoiet's full-sized avatar

ismnoiet

  • Planet Earth
View GitHub Profile
@ismnoiet
ismnoiet / write-append-file.js
Created March 14, 2016 08:58 — forked from umidjons/write-append-file.js
NodeJS: Write/Append into a file
var f='write.txt',
fs=require('fs');
fs.writeFile(f,'Some text to write.',function(err){
if(err)
console.error(err);
console.log('Written!');
});
fs.appendFile(f,'Some more text to append.',function(err){
window.validator = {
tel:/^0[0-9]{8,9}$/,
fax:/^0[0-9]{8}$/,
mob:/^0[0-9]{9}$/,
username:/^[a-z0-9_-]{3,16}$/,
name:/^[a-z ]+$/,
email:/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/,
url:/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w\.\-&\?=]*)*\/?$/,
anything:/.+?$/,
test:function(type,str){
<?php
// Create a pdo instance
$host = 'localhost';
$database_name = 'databasename';
$username='username by default it is root';
$password='the password associated with the current user';
try{
// check if there is exception
$pdo = new PDO("mysql:host=$host;dbname=$database_name","$username","$password");
<!DOCTYPE html>
<html>
<head>
<title>training camp etic 2016</title>
<!-- inlude style file -->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
// first include underscore,backbone and backbone.localStorage
//<script src="bower_components/underscore/underscore.js"></script>
//<script src="bower_components/backbone/backbone.js"></script>
//<script src="bower_components/backbone.localStorage/backbone.localStorage.js"></script>
// 1) defining the model
var Model = Backbone.Model.extend({
defaults:function(){
return {
note:"hello"
sudo apt-get install python-pip
pip install Pygments
pygmentize -f rtf code/i/want/to/highlight.sh > hightlighted_code.rtf
credit:
http://stratus3d.com/blog/2015/08/21/inserting-code-samples-into-libreoffice-impress/
1) append to the end of the ~/.bashrc file
alias gogo="sudo chmod -R 0777 $dest"
2)make bashrc as the current source, in order to consider tha latest modification
source ~/.bashrc
3) give a value for the dest variable
dest="something"
4) call the gogo alias with the value of dest
gogo
@ismnoiet
ismnoiet / gist:5d814aa059317e501e18
Created September 11, 2015 23:18
update-nodejs-to-last-version
@source:http://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
{
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"es3": false,
"forin": true,
"freeze": true,
"immed": true,