Skip to content

Instantly share code, notes, and snippets.

🏠
аааа

jgfhkjtdyj zhepa

🏠
аааа
Block or report user

Report or block zhepa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brbsh
brbsh / rgba_argb.pwn
Last active Feb 12, 2017
Functions to operate RGBA & ARGB hex colors in PAWN
View rgba_argb.pwn
cutAlphaRGBA(rgbacolor) return (rgbacolor >>> 8); // вернет цвет с вырезанной прозрачностью
cutAlphaARGB(argbcolor) return (argbcolor & 0xFFFFFF);
setAlphaRGBA(rgbacolor, alpha = 0xFF) return (cutAlphaRGBA(rgbacolor) | alpha); // вернет цвет с установленной прозрачностью
setAlphaARGB(argbcolor, alpha = 0xFF) return (cutAlphaARGB(argbcolor) | (alpha << 24));
getAlphaRGBA(rgbacolor) return (rgbacolor & 0xFF); // вернет альфу
getAlphaARGB(argbcolor) return (argbcolor >>> 24);
bool:hasAlphaRGBA(rgbacolor) return (getAlphaRGBA(rgbacolor) != 0 && ((rgbacolor >>> 24) != 0));
bool:hasAlphaARGB(argbcolor) return (getAlphaARGB(argbcolor) != 0 && ((argbcolor >>> 8) != 0));
torgba(rgbacolor, &r, &g, &b, &a) // разобьет цвет на состовляющие (red, green, blue, alpha)
@ziggi
ziggi / proxdetector.pwn
Last active Oct 1, 2018
SA-MP ProxDetector function
View proxdetector.pwn
stock ProxDetector(playerid, Float:max_range, color, const string[], Float:max_ratio = 1.6)
{
new
Float:pos_x,
Float:pos_y,
Float:pos_z,
Float:range,
Float:range_ratio,
Float:range_with_ratio,
clr_r, clr_g, clr_b,
@egaumer
egaumer / DSL Examples
Last active Jun 26, 2019
Some example queries using elastic.js
View DSL Examples
# simple match all query with term facet
ejs.Request()
.indices("myindex")
.types("mytype")
.query(ejs.MatchAllQuery())
.facet(
ejs.TermsFacet('url')
.field('url')
.size(20))
@tamoyal
tamoyal / gist:10441108
Created Apr 11, 2014
Create super user and database user in Mongo 2.6
View gist:10441108
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@kosso
kosso / background.html
Created Mar 2, 2012 — forked from mohamedmansour/background.html
Google Chrome Extension to upload a locally stored image to imgurl API service.
View background.html
<!DOCTYPE html>
<html>
<head>
<script>
const API_KEY = 'SOME_KEY';
/**
* Use HTML5 Canvas to get the image data
* @param {HTMLImageElement} img An Image Tag
View video_preview.html
<!--
Tutorial code for: http://www.binpress.com/tutorial/generating-nice-movie-previews-with-ffmpeg/138
-->
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
</head>
<body>
<a href="https://www.youtube.com/watch?v=v1uyQZNg2vE" target="_blank" class="video-preview" data-frames="100" data-source="http://i.imgur.com/BX0pV4J.jpg"></a>
@c0ldlimit
c0ldlimit / git_newrepo
Created Nov 16, 2012
Git: Push a new or existing repo to Github
View git_newrepo
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
You can’t perform that action at this time.