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
NSLog(@"Hello Gist"); |
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
<?php | |
$serverName = "MOHANA-LAPTOP\SQLEXPRESS"; | |
$connectionInfo = array("Database" => "test", "UID" => "sa", "PWD"=>"123456"); | |
$conn = sqlsrv_connect($serverName, $connectionInfo); | |
if($conn) { | |
echo "Connection established .. :)"; | |
} else { | |
echo "Connection could not be established :("; | |
dir(print_r(sqlsrv_errors(), true)); |
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
#git discard all local changes/commits and pull from upstream | |
git reset --hard origin/master | |
git pull origin master |
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
mogrify -format jpg *.JPEG |
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
import cv2 | |
import os.path | |
import os | |
from PIL import Image | |
from os.path import basename | |
import sys | |
from decimal import Decimal | |
from __builtin__ import str | |
isfile = os.path.isfile |
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
import numpy as np | |
from itertools import product | |
def generatePermutationMatrix(n): | |
d = np.zeros((n, n)) | |
index = np.random.permutation(range(n)) | |
p = index[:n/2] | |
index1 = list(product(p, p)) | |
for i in index1: |
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
import numpy as np | |
# Lets suppose you have a 2D array | |
c = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) | |
# Suffle it for rows and columns | |
np.random.permutation(np.random.permutation(c.transpose()).transpose()) |
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
let user = { | |
name: 'Mohanad', | |
sayHi: function() { | |
console.log(`Hi ${this.name}`) | |
} | |
} | |
user.sayHi(); |
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
class User { | |
constructor(name) { | |
this.name = name; | |
} | |
sayHi() { | |
console.log(`Hi, ${this.name}`); | |
} | |
} |
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
class Animal { | |
constructor(name) { | |
this.name = name; | |
} | |
eat() { | |
console.log("Start eating..."); | |
} | |
} |
OlderNewer