Skip to content

Instantly share code, notes, and snippets.

John zecar

  • Bucharest
Block or report user

Report or block zecar

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
View android 3g - iphone 4g - did not work.txt
14: handle_udp_packet: New UDP endpoint: local addr MY_SERVER_IP:443, remote addr MY_IPHONE_IP:3520
14: session 000000000000000001: realm <SUBDOMAIN_DOT_MY_SERVER_DOMAIN> user <>: incoming packet message processed, error 401: Unauthorized
14: session 000000000000000001: realm <SUBDOMAIN_DOT_MY_SERVER_DOMAIN> user <>: incoming packet BINDING processed, success
14: handle_udp_packet: New UDP endpoint: local addr MY_SERVER_IP:443, remote addr MY_IPHONE_IP:3518
14: session 001000000000000001: realm <SUBDOMAIN_DOT_MY_SERVER_DOMAIN> user <>: incoming packet message processed, error 401: Unauthorized
14: session 001000000000000001: realm <SUBDOMAIN_DOT_MY_SERVER_DOMAIN> user <>: incoming packet BINDING processed, success
14: handle_udp_packet: New UDP endpoint: local addr MY_SERVER_IP:443, remote addr MY_IPHONE_IP:3519
14: session 001000000000000002: realm <SUBDOMAIN_DOT_MY_SERVER_DOMAIN> user <>: incoming packet message processed, error 401: Unauthorized
14: session 001000000000000002: realm <SUBDOMAIN_DOT_MY_SERVE
@zecar
zecar / input.scss
Created Oct 30, 2018 — forked from lukasborawski/input.scss
Perfect media-queries screen breakpoints SASS @mixin. Tested on Apple Devices: iPhone4, iPhone5, iPad3, MacBook Pro, iPad Mini. http://sassmeister.com/gist/8529371
View input.scss
$media-queries: true;
@mixin bp($point) {
@if ($media-queries) {
$bp-large-screen: 1824px;
$bp-bigscreen: 1824px;
$bp-ipad-max: 1024px;
$bp-ipad-min: 768px;
$bp-iphone5-max: 568px;
$bp-iphone-max: 480px;
View zsh quick terminal sshes
----- CREATE KEY --------
ssh-keygen -t rsa
ssh user@host mkdir -p .ssh // in case it's not there
cat .ssh/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'
------ IN ~/sl.sh ----------
View gist:fa9c4280dd352df9dbde836a56c74486
The sound produced by the microphone when you put it on your abdomen
It's the noise of a freezing liquid
The popcorn noise when it swells
The noise is caused by the sharpening of a pencil
The noise of a broken sheet of paper
@zecar
zecar / pagination.js
Created Oct 21, 2017 — forked from keon/pagination.js
javascript pagination algorithm
View pagination.js
var pagenation = function(current, total){
var list = [];
var pageLimit = 5;
var upperLimit, lowerLimit;
var currentPage = lowerLimit = upperLimit = Math.min(current, total);
for (var b = 1; b < pageLimit && b < total;) {
if (lowerLimit > 1 ) {
lowerLimit--; b++;
}
View kme.js
var now = moment().tz('Europe/Bucharest');
var nextMorning = now.clone().add(1, 'day').hour(5).minute(0).second(0)
var millsTillNextMorning = nextMorning.diff(now);
function kmeTimer(){
var now = moment().tz('Europe/Bucharest');
var nextMorning = now.clone().add(1, 'day').hour(5).minute(0).second(0)
var millsTillNextMorning = nextMorning.diff(now);
View Javascript easy log.md
window.log = function(){
	window.verboseLog && console.log.apply(null, [].slice.apply(arguments));
}

window.verboseLog = false;
log("john"); // will not log

window.verboseLog = true;
log("qq"); // will log
@zecar
zecar / Javascript Array betterFilter.md
Last active Apr 20, 2017
javascript array.filter faster alternative
View Javascript Array betterFilter.md
Array.prototype.betterFilter = function(expression) {
	var res = [];
	for(var idx=0; idx<this.length; idx++){
		var currentItem = this[idx];
		if(expression(currentItem)){
			res.push(currentItem);
		}
	}
	return res;
View fucking validate email
function validateTheFuckingEmail(email){
var result = {
email: email,
isValid: 'No fucking way',
reason: ''
}
if(!email || email.length == 0){
result.isValid = 'It fucking is valid';
return result;
}
@zecar
zecar / useful
Created Mar 30, 2015
useful shiet
View useful
find js script includes in files
grep -rE "<script[A-Za-z0-9 =\"\/]+src[A-Za-z0-9 =\"\/]+\.js[A-Za-z0-9 =\"\/\>\<]+script" path
You can’t perform that action at this time.