Skip to content

Instantly share code, notes, and snippets.

View zaigham's full-sized avatar
🌏

Zaigham R. zaigham

🌏
View GitHub Profile
@zaigham
zaigham / versionx-hhvm.txt
Last active August 29, 2015 14:21
versionx-install-hhvm-error
Below is the error I could catch... in /var/log/hhvm/error.log
The Manager CMP for VersionX are installed and working fine. but new tables are not created.
===========================
\nFatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02] [1146] Table 'modx23xhhvm.modx_versionx_resource' doesn't exist' in :\nStack trace:\n#0 /home/vagrant/modx/23x/core/xpdo/xpdo.class.php(2500): PDO->query()\n#1 /home/vagrant/modx/23x/core/xpdo/om/mysql/xpdomanager.class.php(131): xPDO->query()\n#2 /home/vagrant/modx/23x/core/packages/versionx-2.1.2-pl/modCategory/c7c31abcbb1216d62f8deff18301a6d9.tables.resolver.resolver(40): xPDOManager_mysql->createObjectContainer()\n#3 /home/vagrant/modx/23x/core/xpdo/transport/xpdovehicle.class.php(226): include()\n#4 /home/vagrant/modx/23x/core/xpdo/transport/xpdoobjectvehicle.class.php(227): xPDOVehicle->resolve()\n#5 /home/vagrant/modx/23x/core/xpdo/transport/xpdoobjectvehicle.class.php(88): xPDOObjectVehicle->_installObject()\n#6 /home/vagrant/modx/23x/core/
@zaigham
zaigham / reactjsnotes.md
Last active June 2, 2016 06:26
ReactJS Notes

Everything is a component.

Keypoints

  • One of the first things you’ll notice in React is that you’ll be writing markup in JS, not in HTML.
  • Do not use class. Instead, use className. It’s because JSX gets translated to JS, and class is a keyword in the newest version of JS.
  • If you use <br> instead of <br/>, it won’t work. Make sure to put / on self-closing tags.

Workflow

@zaigham
zaigham / bootstrap-breakpoints.sass
Created August 7, 2016 11:53 — forked from webinfinita/bootstrap-breakpoints.sass
Variables for responsive design in bootstrap with sass
@mixin breakpoint($point)
@if $point == lg
@media (min-width: 1200px)
@content
@else if $point == md
@media (min-width: 992px) and (max-width: 1199px)
@content
@else if $point == sm

Keybase proof

I hereby claim:

  • I am zaigham on github.
  • I am zaigham (https://keybase.io/zaigham) on keybase.
  • I have a public key ASC9GHD4HGay74R4HPu6TY_2fHeFhkSILheH4bGoOSJERwo

To claim this, I am signing this object:

@zaigham
zaigham / modx-content-search-and-replace.php
Created December 15, 2017 09:43 — forked from christianhanvey/modx-content-search-and-replace.php
MODX utility snippet: replace absolute formed links in site content eg www.xxx.com/99 -> [[~99]] note: backing up modx_site_content table is a good idea before running this :) (original author: BobRay)
<?php
$docs = $modx->getCollection('modDocument');
$pattern = '/www.xxx.com/(\d+)/';
$replacement = '[[~$1]]';
$count = 0;
foreach ($docs as $doc) {
$content = $doc->getContent();
$hash1 = sha1($content);
@zaigham
zaigham / youtube_id_regex.php
Created August 29, 2018 16:08 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ