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
// Converting Twitter Bootstrap RFS mechanism into typescript to make it available for CSS in JS i.e. (styled components). | |
// Twitter Bootstrap RFS: https://github.com/twbs/rfs | |
// Javascript Approach: https://gist.github.com/supposedly/9b9f5de66c2bcbbf5d7469dcec50bfd7 | |
// Usage | |
// import rfs from 'rfs'; | |
// rfs( '20px', 'font-size' ); | |
// rfs( '1.5rem', 'font-size' ); | |
// rfs( '1rem', 'margin-bottom' ); |
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
/* | |
SCSS RFS mixin - converted unofficially to JS | |
Please note that the author(s) and maintainer(s) of RFS aren't responsible for this port. Direct issues to @supposedly | |
******** | |
Automated responsive values for font sizes, paddings, margins and much more | |
Licensed under MIT (https://github.com/twbs/rfs/blob/master/LICENSE): |
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
/** | |
* Wrapper for Http Request. | |
* Uses fetch API. | |
* Mocks are using the following convention : '/pathx/pathy' is fetching ./mock_api/pathx.pathy.js | |
* pathx.pathy.js is a javascript file exporting a default element : export default { prop: 'value' } or export default [{ prop: 'value' }] | |
* | |
* --- Usage with mocks | |
* ----- json under ./mock_api/i18n.EN.js | |
* > const langProps = await http.get<LocaleMessageDictionary<VueMessageType>>(`/i18n/${locale.code}`, undefined, 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
#!/usr/bin/env php | |
<?php | |
use Silex\Application; | |
use Symfony\Component\Routing\Route; | |
use Symfony\Component\Routing\RouteCompiler; | |
use Symfony\Component\Yaml\Yaml; | |
require_once __DIR__ . '/vendor/autoload.php'; |
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
MIT License | |
Copyright (c) 2018 Noel Bundick | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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 | |
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$') | |
do | |
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes | |
if [ $? -ne 0 ]; then | |
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint." | |
exit 1 # exit with failure status | |
fi | |
done |
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
$countryCodes = array( | |
array ( | |
'country_code' => 'AF', | |
'phone_code' => '93', | |
), | |
array ( | |
'country_code' => 'AX', | |
'phone_code' => '35818', | |
), | |
array ( |
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
<?php | |
//server-side code where we save the given drawing in a PNG file | |
$img = filter_input(INPUT_POST, 'image', FILTER_SANITIZE_URL); | |
$name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING); | |
//see http://j-query.blogspot.fr/2011/02/save-base64-encoded-canvas-image-to-png.html | |
$img = str_replace(' ', '+', str_replace('data:image/png;base64,', '', $img)); | |
$data = base64_decode($img); |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
NewerOlder