This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"locale": "ar", | |
"text": { | |
"#authors": [ | |
{ | |
"name": "Muhammad Fawwaz Orabi", | |
"screen-name": "forabi" | |
} | |
], | |
"tweet": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = require('path'); | |
fs.readdir(process.cwd(), function(err, files){ | |
var newNames = {}; | |
files.forEach(function(file){ | |
console.log(file); | |
if (file.match(/.+.txt/i)){ | |
console.log('Found text file', file); | |
fs.readFile(path.join(process.cwd(), file), 'utf8', function(err, data){ | |
newNames[file] = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = angular.module "ng-blog", [] | |
app.controller 'HomeCtrl', ($http, $scope) -> | |
$scope.posts = [ | |
( | |
title: "Hello world!", | |
excerpt: "A simple Hello World!" | |
) | |
( | |
title: "Hello world!", | |
excerpt: "A simple Hello World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function* getPrimes(n) { | |
let compos = []; | |
for (let i = 2; i <= n; i++) { | |
if (compos[i]) continue; | |
yield i; | |
for (let j = i * 2; j <= n; j += i) { | |
compos[j] = true; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function get_file_names { | |
find -type f | | |
egrep -v '/(node_modules)|(.git)/' | # Ignore node_modules and .git | |
egrep -v '^./(tmp|posts|dist)/' | # Ignored dirs | |
egrep -v '.(swp|ttf|txt|css|woff|eot|svg|png|jpe?g|sublime-.*)$' # Ignored file types | |
} | |
function get_loc { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<!-- $XDG_CONFIG_HOME/fontconfig/fonts.conf for per-user font configuration --> | |
<fontconfig> | |
<match> | |
<test name="lang" compare="contains"> | |
<string>ar</string> | |
</test> | |
<test name="family" compare="not_eq"> | |
<string>monospace</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
num_pages=0; | |
for file in *.pdf; do | |
f_pages=$(pdfinfo "$file" 2>/dev/null | grep Pages | cut -d ":" -f 2 | sed -e 's/^[ \t]*//') | |
if [[ -z $f_pages ]]; then | |
echo "Error in $file" && exit 1; | |
fi | |
num_pages=$(( num_pages + $f_pages )) | |
done | |
echo $num_pages; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ rollup --version | |
rollup version 0.25.3 | |
❯ time rollup -c ./rollup.js | |
rollup -c ./rollup.js 4.65s user 0.22s system 118% cpu 4.131 total | |
❯ time webpack | |
Hash: ebb00bbccd954c114d3c | |
Version: webpack 2.0.7-beta | |
Time: 3623ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Auto-RTL | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Fixes layout direction (RTL/LTR) for text on various websites | |
// @author You | |
// @match https://gitlab.com/* | |
// @match https://github.com/* | |
// @match http*://getpocket.com/beta/read/* | |
// @match http*://getpocket.com/read/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import javax.comm.*; | |
/* الكلاس بتعتمد واجهة Runnable مشان نقدر نشغلها بـThread لحالها> | |
/ SerialPortEventListener على ما يبدو جاية من حزمة javax.comm | |
/ بتخلينا نستمع لأي تغيرات على منفذ تسلسلي، | |
/ يعني لما بصير أي شي على المنفذ، فينا نعمل أي شي، | |
/ هي بس شغلتا تخبرنا شو صار. */ | |
public class SimpleRead implements Runnable, SerialPortEventListener { |
OlderNewer