Skip to content

Instantly share code, notes, and snippets.

View khanof89's full-sized avatar
🎯
Focusing

Shahrukh Khan khanof89

🎯
Focusing
View GitHub Profile
@khanof89
khanof89 / Bash
Created January 13, 2015 17:01
bash command
#!/bin/bash
while true; do
begin=`date +%s`
curl GET http://127.0.0.1/getmovieposter
end=`date +%s`
if [ $(($end - $begin)) -lt 5 ]; then
sleep $(($begin + 5 - $end))
fi
$text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#!?&//=]+)',
'<a href="\\1" target="_blank">\\1</a>', $text);
$text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#!?&//=]+)',
'\\1<a href="http://\\2" target="_blank">\\2</a>', $text);
$text = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})',
'<a href="mailto:\\1">\\1</a>', $text);
<?php
$camp_milestone_3 = 'three';
$camp_milestone_4 = 'four';
$three = 3;
$four = 4;
$third = $camp_milestone_.$three;
$fourth = $camp_milestone_.$four;
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="/assets/js/d3/d3.layout.js"></script>
<script type="text/javascript">
var m = [20, 120, 20, 120],
w = 1280 - m[1] - m[3],
h = 800 - m[0] - m[2],
i = 0,
root;
@khanof89
khanof89 / slack.php
Created November 23, 2017 10:29 — forked from stefanzweifel/slack.php
Slack.com Webhook Integration (PHP) - Simple snippet which tells you, how to build your payload array.
<?php
//Options
$token = 'YOUR_TOKEN_HERE';
$domain = 'YOUR_SLACK_DOMAIN_GOES_HERE';
$channel = '#general';
$bot_name = 'Webhook';
$icon = ':alien:';
$message = 'Your message';
{
"name": "triberr/triberr",
"description": "Influencer marketing network",
"keywords": [],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"illuminate/database": "^5.2",
"nesbot/carbon": "^1.21",
$('.quantity-plus').click(function () {
var total = parseFloat($('.total').html()).toFixed(2);
console.log('total ' + total);
var info = $(this).data('info');
var id = info.item_id;
var price = info.price;
var quantity = $('#quantity-' + id).val();
quantity = parseInt(quantity) + 1;
total += price;
var currentTotal = parseFloat(quantity * price).toFixed(2);
$settings = Setting::get();
foreach ($settings as $setting) {
View::share($setting->key, $setting->value);
}
this is in my inventory.js file
inputFieldOnChangeHandler = (event) => {
this.props.dispatch(updateAvailability(event.target.value, this.props.params.facilityId));
this.props.dispatch(getAvailability(this.props.params.facilityId));
};
<InventoryTableComponent
const table = (props) => {
return (
<table className="customeTable tableInventory">
<TableHead/>
<tbody className="admin-list-table-body">
{props.dayNames.map((index, value) => {
return (<tr className="rowClickable" key={value}>
<th className="table_head" key={value}>{moment().format('YYYY-MM-DD') === index ? 'Today' : moment(index).format('dddd')}</th>
{[...Array(24).keys()].map((i) => {
return (<td className="tableCells" key={i}>