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 / capybara cheat sheet
Last active September 17, 2015 06:54 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
/*
Theme Name: loops-inter
Theme URI: http://wordpress.org/themes/loops-inter
Author: Compass Inc
Author URI: http://wordpress.org/
Description: Themes is being developed by Junaid Farooq
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
@ijunaid8989
ijunaid8989 / Gemfile
Last active October 9, 2015 10:38
My Default for Rails App.
source 'https://rubygems.org'
gem 'rails', 'XXXX'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
CREATE TABLE cameras
(
id integer NOT NULL DEFAULT nextval('sq_streams'::regclass),
created_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp with time zone NOT NULL DEFAULT now(),
exid text NOT NULL,
owner_id integer NOT NULL,
is_public boolean NOT NULL,
config json NOT NULL,
name text NOT NULL,
@ijunaid8989
ijunaid8989 / JS Styles
Created December 21, 2015 12:18
Hello!
A little glance on what world is using right now
[WordPress JS Coding Styles](https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/)
[JQuery Officials](https://contribute.jquery.org/style-guide/js/)
[Google Coding Style](https://google.github.io/styleguide/javascriptguide.xml)
$("#merge_datatables").on 'click', '.action-cam', ->
$('#loading-popup').show()
host = $(this).parents('tr').find('td:nth-child(1)').text()
port = $(this).parents('tr').find('td:nth-child(2)').text()
jpg = $(this).parents('tr').find('td:nth-child(3)').text()
d = {}
d.host = host
d.port = port
d.jpg = jpg
$.ajax
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_cron.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
# Using similar syntax as the appdeploy pre hooks that is managed by AWS
set -xe
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>WEATHER API</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Open+Sans">
fnShowHide = (iCol, oTable) ->
bVis = oTable.fnSettings().aoColumns[iCol].bVisible
oTable.fnSetColumnVis iCol, if bVis then false else true
defmodule Password do
@regex_for_mac ~r/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/
def generate(mac_address) do
case check_mac(mac_address) do
{:invalid, message} ->
message
{:ok} ->
password =