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
## author: Ayush Goel | |
## Python 2.7 used | |
## get the Dropbox new API from https://www.dropbox.com/developers/ | |
## mail: ayushgoel111@gmail.com | |
## put in your APP KEY and APP SECRET KEY | |
## do remember to install oauth, setuptools, simplejson | |
## not included by default in Python 2.7 installation | |
## http://pypi.python.org/pypi/setuptools |
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
#include<iostream> | |
using namespace std; | |
/** this is the size of chess board */ | |
#define N 5 | |
/** Given a completed board, this prints it to the stdout */ | |
void print_solution(int state[N][N]) | |
{ | |
int i,j; |
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
// Global var to contain the inorder predecessor | |
node * prev; | |
void add_inorder(node * nd) | |
{ | |
// Base case | |
if (nd == NULL) | |
return; | |
// Recursive call for inorder processing |
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 random | |
# Change this number to get more contacts | |
number_of_contacts = 100 | |
# Give FileName here | |
filename = 'contacts.csv' | |
all_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' |
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
UIImage *contactImage = ({ | |
NSData *imageData = CFBridgingRelease(ABPersonCopyImageDataWithFormat(person, kABPersonImageFormatOriginalSize)); | |
[UIImage imageWithData:imageData]; | |
}); |
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
#! /usr/bin/python3 | |
import PIL.Image as Image | |
import sys | |
imageNamePrefix = "Icon" | |
extension = ".png" | |
sizesToConvertTo = [(58, 58), (80, 80), (120, 120)]; | |
def saveImage(image, imageName): |
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
#! /usr/bin/python | |
import sys | |
def colorForHex(x): | |
if len(x) != 6: | |
return "Poorly formatted HEX", x | |
try: | |
r = int(x[:2], 16) | |
g = int(x[2:4], 16) |
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
#!/usr/bin/env bash | |
if [ $# -lt 2 ] | |
then | |
echo "ERROR: Less arguments." | |
echo "Usage: git-subtree-add <git-url> <ref(commit)>" | |
else | |
REPO_NAME=`echo $1 | sed 's%^.*/\([^/]*\)\.git$%\1%g'` | |
echo "Adding subtree for " | |
echo $REPO_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
def digits(x): | |
return set([int(j) for j in str(x)]) | |
x = 1000 | |
while True: | |
#write code | |
y = int(1.668*x) | |
for i in range(x, y): | |
print i |
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
for i in os.listdir('.'): | |
if i.startswith('.') == False: #Hidden files | |
os.rename(i, i[3:]) |
OlderNewer