Skip to content

Instantly share code, notes, and snippets.

Avatar

ismnoiet

  • Planet Earth
View GitHub Profile
@ismnoiet
ismnoiet / jqueryCode.js
Created Aug 3, 2014
jquery code that helps us to make simple vertical slider
View jqueryCode.js
$(document).ready(function(){
var begin = 1;
var end = 5;
var total =0;
$('.item').each(function(){total++;});
// now total contains the number of retrieved rows
for(i=end+1;i<=total;i++){
$("#"+i).appendTo($("#next"));
@ismnoiet
ismnoiet / print_php_array.sublime-macro
Created Aug 13, 2014
display php arrays in a nice form [write print_r($array) you get echo '<pre>'.print_r($array,true).'</pre>' which is nicer and cleaner to see
View print_php_array.sublime-macro
[
{
"args": null,
"command": "exit_visual_mode"
},
{
"args":
{
"commands":
[
@ismnoiet
ismnoiet / entry
Last active Aug 29, 2015
read text from file in C
View entry
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
View remove-mysq-ubuntu.txt
source: http://askubuntu.com/questions/172514/how-do-i-uninstall-mysql
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
@ismnoiet
ismnoiet / .jscsrc
Created Aug 11, 2015
js code style for jscs it should be installed in each project separaratelly in order to work
View .jscsrc
{
"excludeFiles": ["node_modules/**", "bower_components/**"],
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
View .jshintrc
{
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"es3": false,
"forin": true,
"freeze": true,
"immed": true,
@ismnoiet
ismnoiet / gist:5d814aa059317e501e18
Created Sep 11, 2015
update-nodejs-to-last-version
View gist:5d814aa059317e501e18
@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
View chmod-files-or-directories-ubuntu.txt
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
View syntax-highlighter-impress-linux.txt
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/
View Backbone.localStorage-example.js
// 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"