Skip to content

Instantly share code, notes, and snippets.

View levelsio's full-sized avatar

levelsio levelsio

View GitHub Profile
$('.action-upload-file').bind('click',function() {
$('.upload-file-uploader').trigger('click');
});
$('.upload-file-uploader').bind('change',function(evt) {
var files = evt.target.files; // FileList object
console.log(files);
// files is a FileList of File objects. List some properties.
var output = [];
var imageAsText='';
for (var i = 0, f; f = files[i]; i++) {
<?
// <readme>
/*
This is a lite version of Olark's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
<?
// <readme>
/*
This is a lite version of Olark's and Intercom's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
#killyourdependencies
<?
// <readme>
/*
This is a lite version of Olark's and Intercom's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
#killyourdependencies
/* <type text simulation> */
var currentSampleJob=sampleJobs[0];
var autoTypingActive=true;
var transitionDelayTime=0;
var sampleJobLength=0;
var typingNow=false;
var sampleJobTimer=0;
var timer=null;
var searchElement = $('.search');
<?
// <readme>
/*
This is a lite version of Olark's and Intercom's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
/*
code to match for dating
these are BOOLEAN values
match_gender = the gender of the user itself
match_target_gender = the gender of the target user
if match_gender_male = true it means the user is a male
if match_target_gender_male = true it means the user is looking for a male
@levelsio
levelsio / Is it now Ramadan.php
Last active June 6, 2018 01:58
"Is it now Ramadan?" function in PHP
# by @levelsio
#
# MIT licensed
#
# make sure you enable php_intl on PHP
# you can do by uncommenting ;extension=intl or ;extension=php_intl
# and installing php-intl, e.g. sudo apt-get install php-intl
#
# made for Nomad List to give people a notice if they go to a place
# where it is currently Ramadan
<?
// this bot tries to match chat messages to previous forum posts and links to them
require_once(__DIR__.'/../app/config.php');
require_once(__DIR__.'/../app/functions.php');
loadDbs(array('users_global','messages','questions'));
@levelsio
levelsio / malaysia_singapore.geojson
Last active December 13, 2018 18:30
Singapore + Malaysia country borders in GeoJSON because most are missing Singapore!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.