Skip to content

Instantly share code, notes, and snippets.

View ijunaid8989's full-sized avatar
🇵🇰
It may have escaped your notice but life isn't fair.

Junaid Farooq ijunaid8989

🇵🇰
It may have escaped your notice but life isn't fair.
  • Islamabad Pakistan
View GitHub Profile
@ijunaid8989
ijunaid8989 / SneakPeak
Created October 25, 2016 12:12
SneakPeak
As you requested..
from = "2016-10-24 00:00:00+00" to "2016-10-24 00:00:00+00".. and the time was "Monday":["9:0-18:0"]..
You set the interval to 1800(30 minutes.)
It should be getting pictures for 9 hours with 30 minutes range which were going to be 18..
Results it got 13 Images..
<!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">
<title>Visavail.js Example: Responsive Layout With Bootstrap</title>
<!-- Bootstrap -->
#Easy one and available on stackoverflow
class Array
def flattify
each_with_object([]) do |element, flattened|
flattened.push *(element.is_a?(Array) ? element.flattify : element)
end
end
end
[1,2,3,4,[1,2,3,4],5].flattify # => [1, 2, 3, 4, 1, 2, 3, 4, 5]
description "Puma Background Worker"
# no "start on", we don't want to automatically start
stop on (stopping puma-manager or runlevel [06])
# change apps to match your deployment user if you want to use this as a less privileged user (recommended!)
setuid root
setgid root
respawn
14524] Puma starting in cluster mode...
[14524] * Version 3.6.0 (ruby 2.3.0-p0), codename: Sleepy Sunday Serenity
[14524] * Min threads: 16, max threads: 16
[14524] * Environment: production
[14524] * Process workers: 2
[14524] * Preloading application
[14524] * Listening on tcp://0.0.0.0:3000
[14524] Use Ctrl-C to stop
[14524] - Worker 0 (pid: 14655) booted, phase: 0
[14524] - Worker 1 (pid: 14662) booted, phase: 0
@ijunaid8989
ijunaid8989 / data
Created October 18, 2017 06:19
data
[%EdgeCommander.ThreeScraper.SimLogs{__meta__: #Ecto.Schema.Metadata<:loaded, "sim_logs">,
addon: "60GB Broadband", allowance: "61,440.00 MB",
datetime: ~N[2017-09-28 05:50:04.783484], id: 607, name: "User 5 Sim",
number: "0864667951", volume_used: "18,977.80 MB"},
%EdgeCommander.ThreeScraper.SimLogs{__meta__: #Ecto.Schema.Metadata<:loaded, "sim_logs">,
addon: "60GB Broadband", allowance: "61,440.00 MB",
datetime: ~N[2017-10-10 17:09:19.712257], id: 645, name: "User 5 Sim",
number: "0864667951", volume_used: "45,746.76 MB"},
%EdgeCommander.ThreeScraper.SimLogs{__meta__: #Ecto.Schema.Metadata<:loaded, "sim_logs">,
addon: "60GB Broadband", allowance: "61,440.00 MB",
Dec 18 12:55:48 vpn pptpd[3147]: CTRL: Client 89.100.74.80 control connection started
Dec 18 12:55:49 vpn pptpd[3147]: CTRL: Starting call (launching pppd, opening GRE)Dec 18 12:55:49 vpn pppd[3148]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
Dec 18 12:55:49 vpn pppd[3148]: pppd 2.4.7 started by root, uid 0
Dec 18 12:55:49 vpn pppd[3148]: Using interface ppp16
Dec 18 12:55:49 vpn pppd[3148]: Connect: ppp16 <--> /dev/pts/16
Dec 18 12:55:49 vpn pptpd[3147]: GRE: Bad checksum from pppd.
Dec 18 12:55:52 vpn pppd[3148]: peer from calling number 89.100.74.80 authorized
Dec 18 12:55:52 vpn pppd[3148]: MPPE 128-bit stateless compression enabled
Dec 18 12:55:52 vpn pppd[3148]: local IP address 192.168.80.1
Dec 18 12:55:52 vpn pppd[3148]: remote IP address 192.168.80.120
Mon Dec 18 15:51:00 2017 daemon.notice netifd: Network device 'pptp-vpnconn' link is down
Mon Dec 18 15:51:00 2017 daemon.notice pppd[19043]: Connection terminated.
Mon Dec 18 15:51:00 2017 local1.info hotplug-gsmstate[29590]: envACT: ifdown
Mon Dec 18 15:51:00 2017 local1.info hotplug-gsmstate[29590]: envINT: vpnconn
Mon Dec 18 15:51:00 2017 daemon.info pppd[19043]: Exit.
Mon Dec 18 15:51:00 2017 daemon.notice netifd: Interface 'vpnconn' is now down
Mon Dec 18 15:51:00 2017 daemon.notice netifd: Interface 'vpnconn' is setting up now
Mon Dec 18 15:51:00 2017 user.notice root: stopping ntpclient
Mon Dec 18 15:51:01 2017 daemon.info pppd[29688]: Plugin pptp.so loaded.
Mon Dec 18 15:51:01 2017 daemon.info pppd[29688]: PPTP plugin version 1.00
{
"tags": [],
"envelope": {
"sender": "[email protected]",
"transport": "smtp",
"targets": "[email protected]"
},
"storage": {
"url": "https://sw.api.mailgun.net/v3/domains/evercam.io/messages/eyJwIjpmYWxzZSwiayI6ImRkZGNkYjAyLTNkMjUtNDFjMS05NWZjLWZlMTA1ZTBhZmY1MCIsInMiOiJhN2QwMWM0ZDc2IiwiYyI6InRhbmtiIn0=",
"key": "eyJwIjpmYWxzZSwiayI6ImRkZGNkYjAyLTNkMjUtNDFjMS05NWZjLWZlMTA1ZTBhZmY1MCIsInMiOiJhN2QwMWM0ZDc2IiwiYyI6InRhbmtiIn0="
module Enumerable # or require 'facets/enumerable/frequency'
def frequency
each_with_object(Hash.new(0)) { |item, counter| counter[item] += 1 }
end
end
def anagrams?(s1, s2)
frequency = proc { |s| s.gsub(/\s+/, "").downcase.chars.frequency }
frequency.(s1) == frequency.(s2)
end