Skip to content

Instantly share code, notes, and snippets.

View dinamycam's full-sized avatar
🎯
Focusing

dinamyc dinamycam

🎯
Focusing
  • shiraz, fars, iran
View GitHub Profile
@kzndotsh
kzndotsh / dropdown-terminal.sh
Created September 19, 2023 14:58
dropdown-terminal.sh
#!/bin/bash
# Controls a dropdown terminal for use in i3wm
DISPLAY_WIDTH=1920
DISPLAY_HEIGHT=1080 # May be usefull...
TERMINAL_WIDTH=900
TERMINAL_HEIGHT=400
TERMINAL_X=$(( (DISPLAY_WIDTH - TERMINAL_WIDTH)/2 ))
TERMINAL_Y=500
@gowhari
gowhari / stop-others-bot.py
Created August 12, 2018 06:01
telegram bot that prevents adding bots to group by non admin members, only admins are able to add bots
import json
import time
import logging
import telepot
import telepot.loop
thisbot_token = 'YOUR-BOT-TOKEN'
@alifarazz
alifarazz / Makefile
Last active April 24, 2018 18:03
Makefile for personal kernel development.
# change application name here (executable output name)
TARGET=kernel
LINKERSCRIPT=link.ld
# compiler
CC=gcc
ASM=nasm
QEMU=qemu-system-i386 -kernel
LD=ld
@alifarazz
alifarazz / Makefile
Last active April 24, 2018 18:04
Makefile for personal OpenGL develpment.
# compiler
CC=clang++
# linker
LD=$(CC)
# optimisation
OPT=-ggdb
# warnings
WARN=-Wall -Wextra
# standards
STD=c++14
@alifarazz
alifarazz / Watchdog.py
Created November 19, 2017 13:39
Watches a file, executes commands if the file is updated. (I use it for auto-compilation)
#!/usr/bin/env python3
# -*-coding:utf-8-*-
# usage:
# ./Watchdog.py <subfile> <commands>
# This script takes a <subfile> file and a list of <commands> which it immediately
# executes in a subprocess.
# It kills the subprocess and relaunches it whenever the file changes.
#
@sae13
sae13 / passwdrobot.py
Last active June 12, 2017 20:50
Telegram bot for generating password. http://t.me/passwdrobot
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Simple Bot to reply to Telegram messages. This is built on the API wrapper, see
# echobot2.py to see the same example built on the telegram.ext bot framework.
# This program is dedicated to the public domain under the CC0 license.
import logging
import telegram
from telegram.error import NetworkError, Unauthorized
from time import sleep
# Example ssh config file. Usually located in ~/.ssh/config (user) or /etc/ssh/ssh_config (system)
# This works on both linux and MacOS
# Basic ssh commands converted to ssh/config file format
# Simplest format
# Run with: "ssh blog" => (equivalent to: "ssh ubuntu@example.com" and "ssh -i ~/.ssh/id_rsa -p 22 ubuntu@example.com")
Host blog
@eatonphil
eatonphil / gist:7d57257f65673b343441
Created May 5, 2015 11:47
Bot Dumps Beautiful Uncompiled Spam On My Blog
{
{I have|I’ve} been {surfing|browsing} online more than {three|3|2|4} hours today, yet
I never found any interesting article like yours. {It’s|It is}
pretty worth enough for me. {In my opinion|Personally|In my view},
if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.|
I {couldn’t|could not} {resist|refrain from} commenting.
{Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I’ll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can’t} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service.
Do {you have|you’ve} any? {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may
just|may|could} subscribe. Thanks.|
@eatonphil
eatonphil / functions.c
Last active September 12, 2024 21:39
Introduction to "Fun" C (using GCC)
/**
* This are a collection of examples for C 201.
* These combine concepts you may or may not be
* familiar with and are especially useful for
* students new to C. There is a lot of really
* cool stuff you can do in C without any cool
* languages.
*
* This is file in particular is an introduction
* to fun function usage in C.
@sbz
sbz / mz-tab-urls.py
Created February 4, 2015 21:57
mz-tab-urls: Get Mozilla Firefox tabs URLs on stdout
#!/usr/bin/env python
import ConfigParser
import json
import os
"""
Dirty script to get Mozilla Firefox tabs URLs on stdout
source: https://raymii.org/s/snippets/Get_the_current_or_all_Firefox_tab_urls_in_Bash.html