Skip to content

Instantly share code, notes, and snippets.

View MakStashkevich's full-sized avatar
🍀
believe on the best

Maksim Stashkevich MakStashkevich

🍀
believe on the best
View GitHub Profile
@mayconbordin
mayconbordin / progress_bar.php
Created June 2, 2012 23:55
PHP CLI progress bar in 5 lines of code
<?php
function progress_bar($done, $total, $info="", $width=50) {
$perc = round(($done * 100) / $total);
$bar = round(($width * $perc) / 100);
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info);
}
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 17, 2024 05:49
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@MinecrafterJPN
MinecrafterJPN / BlockItemList.md
Last active February 1, 2019 12:47
Minecraft PE Block / Item List

Block List

ID => BlockName

		0 => "Air"
		1 => "Stone"
		2 => "Grass"
		3 => "Dirt"
		4 => "Cobblestone"

5 => "WoodenPlank"

@noxan
noxan / namegenerator.py
Last active December 27, 2023 06:57
A simple python script to generate random names.
#!/usr/bin/python3
import random
import string
import sys
VOWELS = "aeiou"
CONSONANTS = "".join(set(string.ascii_lowercase) - set(VOWELS))
@zhuowei
zhuowei / 0.8_ids.csv
Created December 13, 2013 00:29
Minecraft PE 0.8 IDs
1 tile.stone
2 tile.grass
3 tile.dirt
4 tile.stonebrick
5 tile.wood
6 tile.sapling
7 tile.bedrock
8 tile.water
9 tile.water
10 tile.lava
@olimortimer
olimortimer / gist:8801155
Created February 4, 2014 10:20
PHP: Replacement http_build_query
<?php
/**
* Recursive function to work through the data
*
* http_build_query in php 5 will screw up array serialisation by encoding the square brackets
* and make it incompatible for passing to an URL's GET segment or sending through post data manually
*
* Thanks to Marco K. (link below), A version intended for php < 5 actually encodes the data correctly
*
# this scrubs emoji sequences from a string - i think it covers all of them
def strip_emoji ( str )
str = str.force_encoding('utf-8').encode
clean_text = ""
# emoticons 1F601 - 1F64F
regex = /[\u{1f600}-\u{1f64f}]/
clean_text = str.gsub regex, ''
@cferdinandi
cferdinandi / foreach.js
Last active October 1, 2020 08:01
A simple forEach() implementation for Arrays, Objects and NodeLists. Forked from ForEach.js by Todd Motto. https://github.com/toddmotto/foreach
/**
* A simple forEach() implementation for Arrays, Objects and NodeLists
* @private
* @param {Array|Object|NodeList} collection Collection of items to iterate
* @param {Function} callback Callback function for each iteration
* @param {Array|Object|NodeList} scope Object/NodeList/Array that forEach is iterating over (aka `this`)
*/
var forEach = function (collection, callback, scope) {
if (Object.prototype.toString.call(collection) === '[object Object]') {
for (var prop in collection) {
# Node-WebKit CheatSheet
# Download: https://github.com/rogerwang/node-webkit#downloads
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions
# Wiki: https://github.com/rogerwang/node-webkit/wiki
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium
# 1. Run your application.
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps
@danieliser
danieliser / es5.js
Last active February 27, 2024 23:11
Convert Hex Color to rgba with opacity
/**
* ECMA2015
*/
function convertHex(hexCode, opacity = 1){
var hex = hexCode.replace('#', '');
if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}