Skip to content

Instantly share code, notes, and snippets.

Jahed jahed

Block or report user

Report or block jahed

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jahed
jahed / linux-problems.md
Last active Dec 27, 2018
All the problems with my Linux installation and how to fix it
View linux-problems.md
@jahed
jahed / imagemagick-tricks.md
Last active Apr 16, 2019
ImageMagick Tricks
View imagemagick-tricks.md
View stub-react.js
function ensureNodes(children) {
if (Array.isArray(children[0])) {
return ensureNodes(children[0])
}
return children
.filter(child => !!child)
.map(child => {
if (typeof child === 'string') {
return document.createTextNode(child);
@jahed
jahed / ConEmu.darcula.xml
Created Aug 30, 2018
Place in ConEmu.xml as appropriate.
View ConEmu.darcula.xml
<key name="Colors" modified="2018-08-30 22:23:58" build="161206">
<value name="Count" type="long" data="1"/>
<key name="Palette1" modified="2018-08-30 22:30:01" build="161206">
<value name="Name" type="string" data="Darcula"/>
<value name="ExtendColors" type="hex" data="00"/>
<value name="ExtendColorIdx" type="hex" data="0e"/>
<value name="TextColorIdx" type="hex" data="10"/>
<value name="BackColorIdx" type="hex" data="10"/>
<value name="PopTextColorIdx" type="hex" data="10"/>
<value name="PopBackColorIdx" type="hex" data="10"/>
@jahed
jahed / hide-one-drive-64.reg
Created Nov 4, 2017
Hide OneDrive from Windows 10 File Explorer
View hide-one-drive-64.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000
View search.js
// Extract the `q` query parameter
var queryStringRegex = /[\?&]q=([^&]+)/g;
var matches = queryStringRegex.exec(window.location.search);
if(matches && matches[1]) {
var value = decodeURIComponent(matches[1].replace(/\+/g, '%20'));
// Load the posts to search
$.getJSON('/search/posts.json').then(function(posts) {
// Remember to include Fuse.js before this script.
var fuse = new Fuse(posts, {
View search-form.html
<!-- https://your-website.com/search -->
<form method="GET" action="/search">
<input type="text" name="q" placeholder="Search titles and tags...">
<button type="submit">
Search
</button>
</form>
<div id="searchResults"></div>
View posts.json
[
{
"id": "adding-search-to-a-static-website/index",
"title": "Adding Search to a Static Website",
"url": "/blog/2016/12/07/adding-search-to-a-static-website/",
"tags": [
"article",
"webdev"
],
"image": null,
View posts.json.erb
<%= blog.articles.map{|article| {
:title => article.title,
:url => article.url,
:tags => article.tags,
:image => if article.data.image then image_path(article.data.image) else nil end,
:date => article.date.iso8601
}}.to_json %>
View nightwatch.config.js
const seleniumServer = require('selenium-server-standalone-jar')
const chromeDriver = require('chromedriver')
const geckoDriver = require('geckodriver')
const launchUrl = 'http://localhost:4567'
const windowSize = { width: 1920, height: 1080 }
module.exports = {
src_folders: 'tests/scenarios',
page_objects_path: 'tests/pages',
You can’t perform that action at this time.