Skip to content

Instantly share code, notes, and snippets.

View moshfeu's full-sized avatar
🇮🇱
Standing for

Mosh Feu moshfeu

🇮🇱
Standing for
View GitHub Profile
@moshfeu
moshfeu / stock.detect
Created February 11, 2015 16:27
Detect stock browser and version - javascript
var iSstock = ((navigator.userAgent.indexOf('Mozilla/5.0') > -1 && navigator.userAgent.indexOf('Android ') > -1 && navigator.userAgent.indexOf('AppleWebKit') > -1) && !(navigator.userAgent.indexOf('Chrome') > -1));
var version = parseFloat(/Android (.*?);/.exec(navigator.userAgent)[1]);
@moshfeu
moshfeu / top-parent-with-class-output.css
Last active June 28, 2018 05:48
Parent with class scss solution
.parent .child {
padding-top: 4rem;
}
.no-padding.parent .child {
padding-top: 0;
}
@moshfeu
moshfeu / READMD.md
Last active March 17, 2018 20:46
[Arduino] 7 segments display present the distance in meters

With this circuit you can present the distance (in meters) with a 7 segments display component.

Component Quantity
Anode 7 Segment Display 1
330 ohm Resistor 1
Ultrasonic Distance Sensor 1

7 segments display distance

@moshfeu
moshfeu / adi-intro-animation.html
Last active June 19, 2018 08:57
adi intro animation
<!-- source http://jsbin.com/tavecu -->
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<title>AngularJS: UI-Router Quick Start</title>
<!-- Bootstrap CSS -->
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="animate.css" rel="stylesheet">
<style id="jsbin-css">
@moshfeu
moshfeu / extension.js
Created September 22, 2018 22:02
Get current line content in vscode extension
const {text} = activeEditor.document.lineAt(activeEditor.selection.active.line);
@moshfeu
moshfeu / pre-commit
Last active September 28, 2018 11:26
pre-commit file to github pages to generate tags pages
#!/bin/bash
# run chmod +x .git/hooks/pre-commit
TAGS=()
for f in $(find . -name '*.md' -mindepth 1 -maxdepth 10 -type f) ;
do
# echo "$f"
while read line
do
if [[ $line =~ (tags: )(\[(.*)\]) ]];
@moshfeu
moshfeu / example.rb
Created October 22, 2018 21:07
display tags list in jekyll page
{% for tag in site.tags %}
<li><a href="/tags/{{ tag[0] | slugify }}" class="post-tag">{{ tag[0] }}</a></li>
{% endfor %}
@moshfeu
moshfeu / webpack.config.js
Created October 27, 2018 20:06
A webpack.config to run jest tests after compile
const { spawn } = require('child_process');
module.exports = {
entry: {
// ...
// add this to let webpack watch on the test files changes
tests: './test/path-to-the-tests-entry.js'
},
// ..
plugins: [
@moshfeu
moshfeu / some-post.html
Last active October 28, 2018 06:51
Using {% raw %} in Jekyll
{% raw %}
{% for tag in site.tags %}
...
{% endfor %}
{% endraw %}
@moshfeu
moshfeu / SassMeister-input.scss
Last active November 20, 2018 07:11
sass mixin for parent with class
// ----
// Sass (v3.4.25)
// Compass (v1.0.3)
// ----
@mixin parent($with-selector: '') {
@each $selector in & {
$l: length($selector) + 1;