Skip to content

Instantly share code, notes, and snippets.

@codecybe
codecybe / loop.php
Created August 8, 2019 09:48 — forked from artoodetoo/loop.php
Start infinite loop PHP from web
<?php
class FileHelper
{
public static function openAndLock($filename)
{
$fh = fopen($filename, 'r+');
if (!$fh || !flock($fh, LOCK_EX)) {
return false;
}
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function () {
'use strict';
window.addEventListener('load', function () {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function (form) {
form.addEventListener('submit', function (event) {
event.preventDefault();
@codecybe
codecybe / React Native Clear Cache
Created April 7, 2019 08:48 — forked from jarretmoses/React Native Clear Cache
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@codecybe
codecybe / costummin.css
Last active April 1, 2019 15:17
cytimerz
body{padding-top:120px}pre{background:#f7f7f9}@media (min-width: 768px){body>.navbar-transparent{box-shadow:none}body>.navbar-transparent .navbar-nav>.open>a{box-shadow:none}}#home,#help{font-size:0.9rem}#home .navbar,#help .navbar{background:#349aed;background:linear-gradient(145deg, #349aed 50%, #34d8ed 100%);transition:box-shadow 200ms ease-in}#home .navbar-transparent,#help .navbar-transparent{background:none !important;box-shadow:none}#home .navbar-brand .nav-link,#help .navbar-brand .nav-link{display:inline-block;margin-right:-30px}#home .navbar-brand img,#help .navbar-brand img{display:inline-block;margin:0 10px;width:30px}#home .nav-link,#help .nav-link{text-transform:uppercase;font-weight:500;color:#fff}#home{padding-top:0px}#home .btn{padding:0.6rem 0.55rem 0.5rem;box-shadow:none;font-size:0.7rem;font-weight:500}.bs-docs-section{margin-top:4em}.bs-docs-section .page-header h1{padding:2rem 0;font-size:3rem}.dropdown-menu.show[aria-labelledby="themes"]{display:flex;width:420px;flex-wrap:wrap}.dropdown
@codecybe
codecybe / js-ajax-php-json-return.html
Created March 29, 2019 20:41 — forked from jonsuh/js-ajax-php-json-return.html
jQuery AJAX Call to PHP Script with JSON Return
<div class="the-return">
[HTML is replaced when successful.]
</div>
@codecybe
codecybe / php-webscraping.md
Created March 29, 2019 09:03 — forked from anchetaWern/php-webscraping.md
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}

@codecybe
codecybe / timezones_array.php
Created March 27, 2019 15:48 — forked from pavellauko/LICENSE
Time zones as arrays (PHP)
<?php
$timezones = array(
'America/Adak' => '(GMT-10:00) America/Adak (Hawaii-Aleutian Standard Time)',
'America/Atka' => '(GMT-10:00) America/Atka (Hawaii-Aleutian Standard Time)',
'America/Anchorage' => '(GMT-9:00) America/Anchorage (Alaska Standard Time)',
'America/Juneau' => '(GMT-9:00) America/Juneau (Alaska Standard Time)',
'America/Nome' => '(GMT-9:00) America/Nome (Alaska Standard Time)',
'America/Yakutat' => '(GMT-9:00) America/Yakutat (Alaska Standard Time)',
'America/Dawson' => '(GMT-8:00) America/Dawson (Pacific Standard Time)',
@codecybe
codecybe / webstoemp-gulpfile.js
Created March 26, 2019 05:14 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@codecybe
codecybe / ffmpegComands.txt
Last active March 18, 2019 07:17
FFmpeg comand list windows
#How to install/setup ffmpeg on windows 7#
link-> https://www.youtube.com/watch?v=YlF8kg5U2kc
#cmd windows 7 change dir#
C:\Windows\system32>cd "C:\Program Files\ffmpeg\bin"
#fix -ffmpeg-windows-7-permission-denied cmd#
Ctrl+Shift+Enter . Run Command Prompt as Administrator click yes
#fix eror height not divisible by 2 for h.264#