Skip to content

Instantly share code, notes, and snippets.

View SethDusek's full-sized avatar
🏠
Working from home

Kamal Ahmad SethDusek

🏠
Working from home
View GitHub Profile
c++:
#include <iostream>
#include "windows.h"
using namespace std;
int main() {
int n;
for (n=10;n>0;n--) {
cout << "\n" << n;
Sleep(100);
{
"working_dir":"C\\MinGW\\bin",
"cmd": ["cmd","C/","start","g++ -o", "$file.exe","$file"],
}
@SethDusek
SethDusek / imgur-screenshot.sh
Created August 10, 2015 05:23
Modified screenshot script Depends: escrotum (sudo pip install escrotum (run sudo apt-get install python-pip if you don't have pip)) curl and xclip.
#!/bin/bash
# https://github.com/jomo/imgur-screenshot
# https://imgur.com/apps
current_version="v1.5.4"
function is_mac() {
uname | grep -q "Darwin"
}
var http = require("http")
var path=require("path")
var fs = require("fs")
var busboy = require("busboy")
var key="YOURKEY" //needed for authentication
function generatename(extension){
var length = Math.floor((Math.random()*10)+1)
var letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",1,2,3,4,5,6,7,8,9,0]
var name=""
for (var i=1;i<=length;i++) {
#!/usr/bin/env python
import subprocess32,requests,pyperclip
from os import system
image = subprocess32.Popen(["escrotum","-s","/tmp/img.png"],stdout=subprocess32.PIPE)
image = image.communicate()[0].rstrip()
key = "INSERTYOURKEYHERE"
upload = requests.post("WEBSITE:PORT",headers={"key":key},files={"file":("img.png",open(image,"rb"))})
print(upload.text)
system("notify-send \"Upload Done!\" %s" % upload.text)
pyperclip.copy(upload.text)
extern crate mioco;
extern crate time;
extern crate bufstream;
use std::str::FromStr;
use std::net::SocketAddr;
use std::io::prelude::*;
//use std::sync::{Arc, Mutex};
use std::sync::Arc;
use mioco::sync::Mutex;
use std::io::prelude::*;
use std::io::BufReader;
use std::str::FromStr;
use std::fs::File;
#[derive(Copy, Clone, Debug)]
struct Position {
x: usize,
y: usize
}
use std::collections::HashMap;
use std::collections::BTreeMap;
use std::fs::File;
use std::io::prelude::*;
use std::str::FromStr;
use std::io::BufReader;
fn get_hm() -> HashMap<char, i16> {
let file = BufReader::new(File::open("/tmp/scores.txt").unwrap());
let mut hm = HashMap::new();
extern crate libc;
use libc::malloc;
use std::ptr;
struct Vecr<T> {
ptr: *mut T,
len: isize,
capacity: isize
}
#![feature(alloc, heap_api)]
extern crate alloc;
use std::ptr;
use alloc::heap;
use std::mem::{size_of, align_of};
struct Vecr<T> {
ptr: *mut T,
len: usize,
capacity: usize