Skip to content

Instantly share code, notes, and snippets.

@oresh
oresh / linkedin-company-search-scraper.js
Created January 10, 2019 13:22
Scrape companies from Linkedin
// Search Linkedin Companies
$ = jQuery;
var $person, text, timer;
var out = [];
var timer = setInterval(function(){
getPeople();
clickPager();
}, 2200);
@oresh
oresh / facebook_chat_messages.js
Created January 10, 2019 13:17
Save chat messages from Facebook
var messages = document.getElementsByClassName('_3058 _ui9')
var name = document.getElementsByClassName('_673w')[0].getElementsByClassName('_3oh-')[0].innerText;
[...messages].map( (message) => {
var out = '';
out += message.classList.contains('_43by') ? 'Me: ' : name+': ';
var text = message.getElementsByClassName('_58nk');
if (text.length) return out + text[0].innerText;
}).filter(message => !!message).join('\n')
@oresh
oresh / todo.html
Created June 5, 2018 15:15
Todo html example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
@oresh
oresh / GIF-Screencast-OSX.md
Created June 13, 2017 13:29 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@oresh
oresh / facebookGrop.js
Last active December 27, 2018 19:36
Get group members csv
// scroll down to the bottom of list of group members
// then insert this code
var wrapper = document.getElementById('groupsMemberSection_recently_joined');
var csv = '';
var people = wrapper.getElementsByClassName('_60rh _gse');
var _csv = [];
var person, position, year;
for (var i = 0, len = people.length; i < len; i++) {
@oresh
oresh / linkedin-search-scraper.js
Last active July 9, 2019 18:45
Gather people data from search results.
$ = jQuery;
var $person, $next, text, timer;
var next_text = '';
var out = [];
var timer = setInterval(function(){
getPeople();
clickPager();
}, 5500);
@oresh
oresh / card filter.js
Last active November 21, 2016 15:34
Filter functionality with cards and category titles
// filter wrapper class, that has checkboxes.
var $filters = $('.filters', context);
if($filters.length) {
var itemFilter = {
itemClass: '.item-container',
categoryClass: '.category-name',
dataArr: 'data-filters',
sectionClass: 'section.category',
sections: $(this.sectionClass),
items: $(this.itemClass),
@oresh
oresh / responsiveimages.js
Created November 8, 2016 12:59
Responsive images by data attribute
var $responsiveImages = $('img[data-mobile-src]');
if ($responsiveImages.length) {
var imgresizeCatch;
var changeImageSrc = function() {
var desktop = getWindowWidth() > 959;
for (var i = 0, len = $responsiveImages.length; i < len; i++) {
var $img = $responsiveImages.eq(i);
if (desktop) {
if ($img.attr('data-desktop-src') != $img.attr('src')) {
$img.attr('src',$img.attr('data-desktop-src'));
86937 isset
43159 echo
31697 empty
29252 substr
26146 count
24248 is_array
22572 strlen
19365 sprintf
18090 unset
16584 str_replace