Skip to content

Instantly share code, notes, and snippets.

View kuwaitbinary's full-sized avatar
💭
Surviving sometimes I am free sometimes I am busy

Abdullah Al Mashmoum kuwaitbinary

💭
Surviving sometimes I am free sometimes I am busy
  • Kuwait
View GitHub Profile
@adeleinr
adeleinr / Apache cheatsheet
Created November 3, 2011 18:10
Apache cheatsheet
MULTIPLE PORTS IN ONE HOST
---------------------------
Syntax:
Port [port]
NameVirtualHost *:[another_port]
Listen [another_port]
@jasdeepkhalsa
jasdeepkhalsa / checkType.js
Created December 25, 2012 23:37
Check JavaScript variable type with the .toString method by ExampleJS.com
function isType(arg, type) {
type = type.charAt(0).toUpperCase() + type.substr(1);
return Object.prototype.toString.call(arg) == '[object ' + type + ']';
}
@justinbmeyer
justinbmeyer / jsmem.md
Last active June 29, 2024 16:00
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
@L422Y
L422Y / osx_automount_nfs.md
Last active May 10, 2024 09:06
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@jerivas
jerivas / memory_usage.py
Created March 1, 2014 19:36
Python script for determining memory usage for the current user. Taken from https://wiki.webfaction.com/attachment/wiki/MiscellaneousFiles/memory_usage.py. Minimal modifications to make it PEP8 compliant.
#!/usr/bin/python
# Determine memory usage by the current user
# From https://wiki.webfaction.com/attachment/wiki/MiscellaneousFiles/memory_usage.py
# Minimal modifications to make it PEP8 compliant by https://github.com/jerivas
from pprint import pprint
import os
import pwd
import re
@bostondv
bostondv / memory_usage.py
Created March 23, 2014 17:46
Webfaction memory usage script
#!/usr/local/bin/python2.5
import subprocess
import sys
import re
import os,pwd
from pprint import pprint
class TerminalController:
"""
@spraveenitpro
spraveenitpro / gist:11036225
Created April 18, 2014 10:22
Apache CheatSheet
Apache Cheat Sheet
Setup a Virtual Domain
NameVirtualHost *
<VirtualHost *>
DocumentRoot /web/example.com/www
ServerName www.example.com
ServerAlias example.com
CustomLog /web/example.com/logs/access.log combined
@msaisushma
msaisushma / Algorithm.txt
Last active May 9, 2019 18:21
Algorithm and Python code for a typical two players Snakes and Ladders game.
Algorithm for snakes and Ladders game in python
1)There are two players and they are given a dice
2)Typically the game board has 100 cells starting from 1 to 100
3)There are snakes and ladders in different cells. And each has either a ladder or a snake or nothing but not both snake and ladder in the same cell.
4)I use two python dictionaries namely 'snakes' and 'ladders' to declare the positions of snakes and ladders.
5)I make starting cell number of snake or ladder as 'key' and ending cell number as 'value' of the dictionary.
6)Define a function to roll the dice i.e., accepting the input from Player1 and Player2 with a checking condition of dice number to be between 1 & 6.
7)Define a function to check if Player1 or Player2 found ladder or a snake mouth.
8)Check for the 'key's in both dictionaries & proceed accordingly.
9)The rolling of dice continues until any of the player reaches above 99, if any of the players reach 100 they will be declared as winner of the game.
@fffaraz
fffaraz / apache.md
Created December 21, 2014 23:31
Apache Cheat Sheet

Source

Apache Cheat Sheet

Setup a Virtual Domain

NameVirtualHost *

DocumentRoot /web/example.com/www

@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1