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
from easygui import * | |
import sys | |
import os | |
from PIL import Image | |
size = enterbox(msg='Enter the image size, example: 800x600', title=' ', default='', strip=True) | |
filename = sys.argv[-1] | |
width = size.split('x')[0] | |
height = size.split('x')[1] | |
img = Image.open(os.path.join(directory, image)) |
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 python3 | |
import gi | |
gi.require_version('Gtk', '3.0') | |
from gi.repository import Gtk, Gdk | |
import subprocess | |
import os | |
def run_gist(description, file_content, filename): | |
file_path = os.path.join("/tmp/", filename) |
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 python3 | |
import operator | |
x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0} | |
sorted_x = sorted(x.items(), key=operator.itemgetter(1)) |
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 python3 | |
import sys | |
import gi | |
gi.require_version('Gtk', '3.0') | |
from gi.repository import Gtk, Gdk | |
import xerox | |
picker = Gtk.ColorSelectionDialog("Color Picker") |
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 get_pid(name): | |
outputCMD = subprocess.Popen( | |
['pidof', 'vivaldi-bin'], stdout=subprocess.PIPE) | |
return outputCMD.stdout.readlines() |
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 sort_dict(d): | |
return dict(sorted(d.items(), key=operator.itemgetter(1))) |
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 python3 | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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> | |
int main(){ | |
using namespace std; | |
short things[] = {1,2,3,4,5}; | |
int num_elements = sizeof things / sizeof (short); | |
cout << num_elements; | |
} |
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> | |
int main() | |
{ | |
using namespace std; | |
string s("Hello World!!!"); | |
// convert s to uppercase | |
for (auto &reference_to_s : s) // for every char in s (note: reference_to_s is a reference) | |
reference_to_s = toupper(reference_to_s); // reference_to_s is a reference, so the assignment changes the char | |
cout << s << endl; | |
} |
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> | |
std::string safada(std::string input) { | |
return input; | |
} | |
int main() { | |
using namespace std; | |
cout << "eae manel já cherou uma hoje?" << endl; | |
string oi; |
OlderNewer