Skip to content

Instantly share code, notes, and snippets.

View unobatbayar's full-sized avatar

Uno unobatbayar

View GitHub Profile
@alexle
alexle / pythonsms.py
Last active December 1, 2023 01:01
How to send a text message with python
# sms.py
# Sends sms message to any cell phone using gmail smtp gateway
# Written by Alex Le
import smtplib
# Use sms gateway provided by mobile carrier:
# at&t: number@mms.att.net
# t-mobile: number@tmomail.net
# verizon: number@vtext.com
@gitaarik
gitaarik / git_submodules.md
Last active April 22, 2024 10:52
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@iovar
iovar / proxy.php
Last active February 24, 2024 18:29
Simple PHP Proxy Script
<?php
/*
* Warning! Read and use at your own risk!
*
* This tiny proxy script is completely transparent and it passes
* all requests and headers without any checking of any kind.
* The same happens with JSON data. They are simply forwarded.
*
* This is just an easy and convenient solution for the AJAX
@msrose
msrose / combining-git-repositories.md
Last active April 22, 2024 19:05
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

import urllib.parse
import urllib.request
import re
import json
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
page = "List_of_chess_grandmasters"
@soheilbm
soheilbm / encrypt_xor1.swift
Created February 11, 2016 17:28 — forked from alskipp/encrypt_xor1.swift
Swift encrypt/decrypt string using XOR
import Foundation
extension Character {
func utf8() -> UInt8 {
let utf8 = String(self).utf8
return utf8[utf8.startIndex]
}
}
func encrypt(c:Character, key:Character) -> String {
@lopspower
lopspower / README.md
Last active April 26, 2024 07:55
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@capnslipp
capnslipp / NonDrawingGraphic.cs
Last active April 20, 2024 17:48
A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @creator: Slipp Douglas Thompson
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>.
/// @purpose: A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing.
/// @why: Because this functionality should be built-into Unity.
/// @usage: Add a `NonDrawingGraphic` component to the GameObject you want clickable, but without its own image/graphics.
/// @intended project path: Assets/Plugins/UnityEngine UI Extensions/NonDrawingGraphic.cs
/// @interwebsouce: https://gist.github.com/capnslipp/349c18283f2fea316369
using UnityEngine;
using UnityEngine.UI;
@simonewebdesign
simonewebdesign / install-quake3.sh
Last active November 14, 2023 19:25
Install Quake 3: Arena on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
# Copyright (c) 2016 simonewebdesign
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@andrewlimaza
andrewlimaza / honeypot-example.php
Last active October 5, 2023 04:20
Simple honeypot for an HTML form using PHP
<?php
//check if form was sent
if($_POST){
$to = 'some@email.com';
$subject = 'Testing HoneyPot';
$header = "From: $name <$name>";
$name = $_POST['name'];